changed OS detection routine to use sys library, and added support for O...

...S X platform.