Code Tidying

Made the code a bit neater in some places.
Added a require() function to objects for error handling.
Standardization of certain code aspects.
Renamed misc.js to Utilities.js.
Lots of small fixes.