hexadecimal: Rewrite with more sophisticated errors

The errors returned by ParseHex now differentiate between syntax errors
and overflow errors. The errors definitions are taken directly from the
strconv package.
ParseHex was rewritten as an adaptation of strconv.ParseInt in order to
adopt good coding patterns.
The tests were also adapted from atoi_test.go test suite in the strconv
package.