Completely rewrote database connection classes to work with PDO.