Set the global EntityManager instance in the ctor.

The EntityManager singleton was not being set, causing a crash at
runtime. It is now set in the EntityManager constructor.