Refactor template search

Looks for a smarty .tpl template then a .twig template then finally
plain .html when trying to match via the DefaultController
Tests the libraries to handle Smarty/Twig are installed also