Adds JavaScript versions of DecimalFraction and BigFloat

Much of the rest of the changes are to prepare for the JavaScript
translation, including avoiding the use of "long", where possible.