Fix cyclical import.
Add Engine.replace() interface.