Move platform-dependent code to subdirectory.