Get basic templating working. In drastic need of a cleanup though.