Reverted main.php

Reverted to original code with a single require_once to another file
with Namespaced functions