Refactor EntityManager proxy mechanism to support provider pattern