Added reading and writing for js ints

Currently only JavaScript integers up to 2^48 are supported (the
maximum JavaScript integer is 2^53).  Supporting longs is not yet
implemented