Javascript port of Ruby Units for quantity calculation and unit conversion