Implement packing of unsigned integers.

Closes #322.