Added code for Windows, OS X, Solaris, BSD, and Linux. Right now, only the Windows version has been tested.