Extensions homogenization, clened up.

Rebased and cleaned up version of extension homogenisation. I will give some comments that should be fixed before merge now.
This is weirdly formated, hard to read and hard to check. 

Also, I noticed you love the pattern `foo |> function ...` but it's just a weird way for do `match foo with ...`. Please use the latter in general.