Cleaned up and finalized basic style, minified and tidied up code