Adding some functin/class based documentation, added a template module and moved ENGINE to sperate class file for clarity