Squashed changes for build working both on MSVC and other compilers.
Merge pull request #289 from l-korous/master

Make entire library code compile on MSVC & gcc.