Mac OSX, Win64 and Linux additions.

Working Max OSX, Win64 and Linux build.

This also includes the sample changes by @r-lyeh, you may need to check with him on the license change before merging.