Added twos-compliment helpers and tests