Extensions homogenization, clened up.

Rebased and cleaned up version of extension homogenisation. I will give some comments that should be fixed before merge now.
See comment https://github.com/ocsigen/ocsigenserver/pull/52/files#r21803845