Vs native optimizer fixes

Adds build fixes to the native optimizer code so that it builds on Visual Studio 2013. VS2013 has only partial support for C++11, and more specifically, unrestricted unions could not be supported. It looks like those are used only for memory footprint optimization, so not that critical?

Also adds a CMake script for manually building native optimizer on different platforms.
this might not be enough, in some very unlikely situation. please add that check as an assert, perhaps?