Resolve PDO issues, and other assorted code changes
Update database calls to new database layout