Add FreeBSD compatibility
Merge pull request #14 from alanpearce/freebsd

Add FreeBSD compatibility