Build fixes for *nix

Supersedes #27. Fixes several issues where functions were added to Windows specific code, but compatible code was not added for *nix/Mac implementations.