Add utilities for working with binary data

This utilities help to mitigate differences between Python 2 and
Python 3 when it comes to encoding and decoding binary data. They
will be widely useful across taskflow, including ZooKeeper logbook
and storage backend patches.

Initially from change I1de1525df0deee612fb14ca36f0415ea7d2f707c by
Joshua Harlow, reworked for better handling of non-ascii characters.

Change-Id: I4136fd6d7e55b716b0ba5eab838d17a77095c726
Merge "Add utilities for working with binary data"