Continued refactoring to PDO and renaming of functions and associated files. Code clean up and formatting.