Made final changes to use PDO. Formatted source code and various cleanup.