Finished rewriting the db class to use mysqli instead of pdo.