The static entity manager instance is removed.

Instead a new entity manager instance is created each time.
This is because the entity manager is not thread safe so it should not be a single static instance.