HUE-141: Front-end for Shell app

Review Request #1719 — Created April 22, 2011 and updated — Latest diff uploaded

andyao, marcus, nutron, shawn, Thomas
Here's the front-end portion of the Hue Shell. It's basically unchanged from what I had submitted earlier, but I'd like you all to take a look and see if any of these things are no longer how we do them. I'm not particularly thrilled about the code that creates the menu of available shell types, but what I want is a bunch of uniform-width buttons, and I couldn't figure out any other way to do that.

Supports multiple shells
Multiplexes one network connection for all instances of app (Hue.ShellPoller)
Bash-style command history if you push the up and down arrows.
If you wait for the POST /prefs/state request to occur after you start your shell, opening Hue and logging in as the same user in another browser (or browser tab) restores the shell, and you can type commands into either tab/browser. Output goes to both browsers.
Exponential backoff on failed requests (new!).

Known issues:
Blinking cursor doesn't always appear in Firefox (not sure if this is worth fixing, please chime in)
If you click the 'X' to kill a shell in one browser/tab while concurrently viewing it in another browser/tab, it is possible that the other doesn't immediately get that info. This has to do with how the backend is structured. This is a really rare case so I'm not worrying about it, but I can figure out how to solve it if you think it's important. In any case, if you try typing a command into a shell that you killed in another browser/tab, it then realizes that it was dead the whole time. This is a small regression.
Works in FF, Chrome, and IE8. Didn't test Safari.