Add a new Extension.initialize function for doing initialization.

Previously, custom extensions would subclass __init__, take the required
arguments, call the parent function, and perform initialization. In
order to simplify this a bit, extensions can now choose to override
initialize() instead, which will be called by __init__.

This function does nothing by default, and does not need to be called by
the subclass. That simplifies extensions, saving some code.