Removing POSIX dependence, enabling windows support