Move assert() into the engine and reimplement expect around it.