FreeBSD support
Merge pull request #396 from ebfe/freebsd

FreeBSD support