MingW compilation (windows). Includes various refactoring to improve portability.