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.
please do the ifdef trick here too - this is the most performance sensitive structure here. doubling its size is bad.