Move Windows specific code to its platform module