Fix signed integer reading

Reading signed integers would fail if the integer wasn't negative,
because it would be packed as an unsigned integer

Added tests to catch problems like this

Uniformly handle endian conversion (all done in cmp_read_object)