rewrite for multi-os support.
Merge pull request #7 from gregpalmier/master

rewrite for multi-os support.