Modification to make nupic.core more friendly to Windows

It's a PR to track the work on #103 , I don't know if it would get `nupic.core` build under Windows in the end, but I can definitely fix some obvious unfriendly part.

The primary goal for this PR is:

* make CMake deal with compiler flags in a more cross-compiler way(mostly make it firendly to MSVC)
* make platform-specific codes deal with MinGW/Cygwin/MSVC separately 

This is not finished and please do not merge yet.
Merged master in and this is automatically fixed by David's PR.