fixed problems address in pull request comments
fixed issues addressed in pull request comments

    -commented functions and important control flows
    -added link getID function for redirect
    -removed out of date comments
    -put all initialization code in common.php
    -added check to register.php that restricts and redirects logged in users from registering
    -deleted test file