Refactor windows version detection code.

Added Windows 8 and Windows Server 2012 and use a switch on major and
minor number instead of a set of ifs.