netwatch: add OS X support (and fixes for R16)

These commits:
  * clean up code a little
  * fix Erlang R16 warnings
  * add a simple start/stop test
  * add support for Mac OS X