Use osfamily

This is somewhat of a refactor, adding support (or at least graceful failure) on multiple platforms.