moving some functions to top level object
remove zero count groups in datagraph.js, see #563