Add unittests for state transition.
Add two basic performance tests.