Fixes to Query and EntityManagerFacade and a couple more legacy tests in place.