added templating system. Really should have been a branch.