Improved transaction state model and added state transition rules, agents fully stateless, bugfixes