Added private key encoding/decoding.
Cleaned up varint.