this was awkward at best before (very old code). however the change is pretty big and is thus
worth a careful review - the main issue possible is not being locked as widely as it should be
somewhere, not so much the specifics of any one line of the change.
also cleaned up the Context constructors to be more readable and got rid of one completely
made several Context object members const