Centralized MySQL server access

mysql_connect() and mysql_select_db() are made to only appear in
database.php, also the global variable $course_num is now only defined
once in header.php