Refactor index.php file
Changes:
Added Class Autoloader and put all functions in it
Added Doc blocks in it.