Add a state-based plugin framework and an example plugin