Some codechanges in class.database.php; remove typos, add comments, remove obsolete code.