more work on plugins. also fixed problem with carrying 'this' context
through multiple calls to the same function