Move message binary building and parsing to separate library