Almost complete State pattern. Missing tests.