Support F# 3.1

Fix #102, #116, #120.

Most of the changes are visible at https://github.com/fsharp/fsharp/commit/d4e8b9b09a839b082ee8175d3670018054fe98c0