Various additions to make plugin API more powerful