Accept generator as second argument to Realm constructor

This is used when instantiating realms from omni.app.make_application(),
which the CLI uses.