* Initial version of state tests. * Refactor state to support tracing. * Unify TransactResult. * Add test.