Replaced mysql_real_escape_string() function by 'DB::getConnection()->quote'.
Continued refactoring to PDO and renaming of functions and associated files. Code clean up and formatting.