Finished implementation of new template engine