Code Cleaning

I've just went through and cleaned up a lot of the code (re-indented, adding/removing extra spacing, remove unused code). I'm planning to add extra functionality e.g. Cron processing of courses.

For this to happen I need to have the code nice and clean. I've tested the code in my environment and it works fine, let me know if you have any issues with the changes.