Use a class-based model for the state tracking.
Merge pull request #5 from pthedinger/master

Use a class-based model for the state tracking.