Simplify C++ version of hwserver

We can isolate OS differences in a single place and have the rest of the
code being universal.  This will improve code readability.
Merge pull request #452 from xakon/master

Simplify C++ version of hwserver