Added header file for encoding
Use the new 'encoding' library for hex
Fixed some commandline options
Cleaning up the encoding/decoding code