New plugin API. Reimplement old add_extension API on top of new API for backcompat.