Improve test and example for hexadecimal

Modified the tests to:
* be more idiomatic, and return an error when an input is invalid.
* accept both uppercase and lowercase hexadecimal inputs.

Changed the example.go file to have a better annotated solution, that is in my opinion also a better solution.