Core functional representation

Resolves #710 when merged, but not even nearly ready yet.

Not sure there is much to talk about yet, I was hoping to get a bit further with it, so everything is subject to change still.
I'd have to re-add the `IfThenElse` constructor when dropping `Case` for this to be done too, at the moment that gets desugared into a pattern match also.