Rewriting a ~2800 line javascript d3 app in backbone