Start reorganisation of optimisation.

Start with a new monomorphisation routine,
which is to be run before inlining.
As of this commit the routine runs but does not
influence the compiler.