Closes #147

Refactored a bunch. Moved javascript to coffee script into its own file.
Encapsulated in a function to keep global space clean.
Refactored the controller functions to be more similar and deal with
ruby objects only.
Refactored the JS to remove duplication.
Added the feature to hide the graphs until there is something to show.