Query Changes and File Deletion

Removal of unused files and changing MySQL statements to reflect changes
in DB.