Move D3 init out of queryvis.js. 
Fix issues in by the comments.