Added plugin.expose() so that plugins can expose runtime state to the app that registered it
Fixed a potential bug in the plugin registering tests (variable plugin was being overridden, which could have caused issues)