Adds compression flag to toHex/toBin and tests

As the title says, this allows you to simply get the compressed or non-compressed public key.
This functionality already existed in `toBytes`, I just made it accessible from the other output formats.