Mono compatibility

Here is an updated version of the mono compatibility patch, with the changes from the F# team. Could someone please check that it works on windows now?