Replaced the __autoload function by a registered anonymous load function.
Made final changes to use PDO. Formatted source code.
Clean up and formatted source code.