Added UMD definition pattern from https://github.com/umdjs/umd/blob/master/returnExports.js
add option to add totals