added .gitignore

generated by Visual Studio 2013 "Add Git Repositry" function.
upgrade solution/projects
fixed compile error at std::min/std::max

added include algorithm