clang-format: check for GNU sed on OS X
Merge pull request #49 from toxeus/gnuSed

clang-format: check for GNU sed on OS X
Rearranged ProcessMessage function flow for clarity and less nesting.