move EntityMapper implementation to a trait

to allow custom doctrine repositories to be extended from third party
ones

also add a test
add EntityManagerAwareInitializerTest