Bugfixing of previously implemented check and made the scripts work with subdirectory installation

 * Using twig/jinja2 template syntax
 * hrefs are relative now while a base tag is added
 * template variables are now lower-cased
 * comments added in index.php
 * bugfix: using array_key_exists instead of isset