Add initial OpenBSD support.

Based on the work of @buzzdeee, but without conflicts with changes in master. Closes #448 
@3flex Ok, I'll try to fix it in one of the following days.