MAJOR JavaScript clean-up, refactoring, and documentation

cleaned up client-side code
major refactoring in javascript
including adding dari plot builder that encapsulated all d3
functionality
added detailed thorough comments