Reimplementing the hex to byte array conversions so that the code doesn't use node's Buffer class.