refactor to have the d3 helpers be static methods on a class instead of globals on the window