Fix write_varint() call.
Use ticket #41: use array for sequence decode where possible

PyPy, before:
        100 loops, best of 6: 2.46 msec per loop

After:
        100000 loops, best of 6: 6.42 usec per loop