Use orm.em to get EntityManager if present

I am not sure if this is the really correct way, but I've tried
to follow the conventions I could infer.

I think `orm.em` is the accepted convention to store the Entity manager,
but I don't really like relying on these documented ways.

Anyways, this works and is better than the previous commented code.

I hope you'd be able to improve it in the future.