Add support for FreeBSD, clean up some logic with $::osfamily