large code refactor and tidy up

JS cleaned up some more
CSS and HTML formatting and design in the process of being updated