Fix some unit tests to remove dependencies from Hector for core classes
Rework on em.getReference() to avoid hitting the database