Re-arranged, changed some code

Fixed issue of connecting to the server after UIUC Engineering changed
the server setup. Also changed to mysqli instead of mysql since it's
deprecated.