Extracted a TextEncoder interface and encapsulted base16 and error
correcting implementations