Fix rational number handling, add tests, and update JSON implementation since a new JSON RFC was just published