Tidied up some code. Consolidated Javascript. Added colors to events.