Factor out the engine
start to split engine into remote and local...

but need to do some more work on RPC clients...