state modification declaration

Added a `state` section to block declaration api.
It supports 2 types of notation:
 - function
```
function(result, context) {
    // should return a patch to state
}
```
 - jresult object
```
{
    id: '.id',
    content: '.data'
}
```