Localise the RichToSimple by adding location info

Names of let-bound functions now don't need to be unique, so tests can
be run with optimisations again. The problem before was that functions
got inlined with the same let-bound identifier.

The location info is stored so it is now possible to see on an
identifier if it was lifted out because of lambda, case or let.