Refactored the PHP code

Moved html head information into template files, moved template includes to the
/inc directory and updated all the pages.