Converted template into PHP pages

Changed the HTML pages into PHP pages and broke them into modules that
can be included on other pages. Also redirected the modules if the page
is not a valid page