refactored to only load d3 and jquery when needed
more cleanup