Fsharp 3.1 changes

The last commit shown #20f6437 is the full list of changes to be re-applied to F# 3.1

No matter which way Ive tried to do the merge the history is brutalised. Maybe someone else could merge this over, I seem to keep making it a mess.