Added plugin state API. There's some magic to make plugin instance variables state variables, but it's disabled until we're sure we really want it.