Initial support for FreeBSD platform

Hello!
Could you please accept this pull request - makes FreeBSD supported platform.
Thanks!