Merge changes I3a908b0f,I582d44d5 into sc-dev

* changes:
  Implement the state machine
  Add move-only lambdas support