Big cleanup, full support for windows