template + config

added template and config support.
Ceck out the cfg/config.xml file and the cfg/templates/ folder.