Add support for negative values in compact bytes (i.e. target bits)

This adds handling of negative values in compact bytes.

The encoding method does not currently handle signed values, and tackling that is a significantly more complex task, so is left for a later patch.