*BSD support
Merge pull request #169 from isage/freebsd

Better crossplatform support