Add template engine => twig and fix some issues elsewhere