Fix BitstreamReader.parse() to handle large values properly.

Add some unit tests to cover the new huge value handling behavior
of BitstreamReader and BitstreamWriter.