Fix D3JS scoping issue

This commit fixes the problem where multiple d3 graphs on the same view
mess up each other due to variable scoping in javascript. This solution
was to wrap one of the js files that conflicted in a closure to
painfully define what scope the variables should have per js file.