Add VS 2013 support for cmake

Add VS 2013 support for cmake
Fix min/max compile errors.
```std::stod``` won't help here
Also, see https://connect.microsoft.com/VisualStudio/feedback/details/794104/strtod-does-not-implement-the-c99-c-11-standard

The nearest VS version where strtod should be fixed is VS2014.