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.
and i guess we are limited to a 32bit number of inputs here, so yeah, that's good.