janitorial, cleaned up all the files

raw sql queries have been separated to keep the app files neater.