port of Chronic's numerizer lib to JavaScript