Added a lot of OS detection.
Merge pull request #3 from kaspernj/kj/os_detection

OS detection impl.