cleanup abstract entity, and extract EntityManager interface

Note that the vast majority of file-mods are in the last commit ("Update uses of managementContext.getEntityManager()"), which just changes stuff to use the methods in managementContext.getEntityManager() rather than managementContext.manage(Entity) etc.

So please focus mostly on reviewing the contents of the other commits.