Some of the very basic engine code. Note that this is totally untested.