Re-structure utils.py to simplify reading.
Make cpp_message and decoder python 3 compatible.