Primary engine implementation

Branch can be merged as the ZPlay engine is no longer threaded.