refactor(balanced.js): UMD, fix global, helpers