Mingw32 support

Added Mingw32 support so we can drop the MSVCRT##.DLL depend
Also change the DLL code to use plain C
Merge pull request #1 from alama/master

Mingw32 support