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.