Added better serialisation and mingw build script