Decided to start from scratch. Mostly got the Template and Database engines running. The Session engine hasn't been tested yet. The Database engine is working perfectly as far as I can tell at the minute. The Template Engine has been largely untested but the parts I have tested are working.