Migrate runEngine to EngineM.

We may want to change the name, it's a bit meta right now.
Move terminate/cleanup to EngineM.