Extensions homogenization, clened up.

Rebased and cleaned up version of extension homogenisation. I will give some comments that should be fixed before merge now.
1. No space between ocamldoc documentation and the function
2. Please add documentation for the two optional arguments.