State pattern implementation
Merge pull request #2 from BastianW/experimental-state_pattern

State pattern implementation