Added defaults, dynamic loading.

Also replaced the internal handling of current entity manager with
lifcycle event args.