[Extensions] Decouple the FunctionHandler from the Internal Extension Context

This is the first step for removing the InternalExtension class. The idea here
is to delegate the wrapping of callback ids to the FunctionHandler and make
it optional using composition.
[Extensions] Convert the parameters of the function handlers into a struct

The previous syntax was too verbose and now with the struct, adding
a new parameter won't cause a mass rename.
[Extensions] Remove the InternalExtension class

All the functionality was moved tho the ExtensionFunctionHandler and
can be optionally used via composition.