Terminal.diff and apply

Ok, I know how hard it is to receive these kind of extended pullrequest, so let me begin by apologising.

The pull request is meant to be the basis of an extended diff and apply (including meta info like cursor , mode, led changes etc...) .

It should not interfere right now with any of the existing code. With it I'm now able to do:

```
 var diff = term1.diff(term2);
 term1.apply(diff); //puts term1 in the same state as term2
```

By writing this patch, I've also added the necessary primitives/commands that a listener of events can use.  The next step(s):

1.  I'd like to take is indeed write the event mechanism (and replace the browserify to make the events also possible for use in the browser.
2. Write the Webrenderer that can receive this events or changes through a patch

Please consider merging this patch, I'll be happy to talk/discuss/document this to you.
Or talk about it online (drop me mail at github AT jedi DOT be )