Initial stab at making the native stuff multi-platform. Only checked on Windows