Finished rewriting the engine. ERB now works fine