pmlopes/yoke — pull request #116 by XiaochunLU (2014-07-11 16:14:08+00:00)
Title: Fix some bugs and add some new features in js binding

One of our prototype projects is using Yoke javascript as the frontend framework, but find its js binding is rudimentary as compared to the Java implementation. Still we think it could fulfill our need as long as some minor changes be made to it. Now our prototype is finished, and we think our changes could contribute back to Yoke.

Bugs or features that are fixed or added:
a. In JSYokeRequest, *createSession* and *destroySession* should be function instead of property
b. Create a shortcut to get response from request, so that you can write:
```javascript
router.get('/hello', function(req) {
req.res.end('Yoke');
});
```
c. Make it possible to pass native JSON to session or response.end(), such as:
```javascript
router.get('/hello', function(req) {
req.session.mydata = {
foo: ['bar']
};
req.res.end({
success: true,
data: {
foo: ['bar']
}
});
});
```
d. Add implementation for TODO tasks in JSUtil. Now use Rhino *Context.javaToJS()* to convert java object to js one
e. Make session object save to store only when it is changed. A new *com.jetdrone.vertx.yoke.store.json.SessionObject* is added, a wrapper around the existing *JsonObject*, and it is aware of changes of its fields or field of fields. This is because most of the time the session object is retrieved but not changed, and saving to external store such as redis or mongodb would have performance impact.