Why go through the trouble of emulating the shell environment instead of just writing this in a shell environment? An actual shell environment for this would actually be somewhat useful, whereas a terminal emulator in the web doing this isn't really that useful.
Not to mention, if it was written as an actual shell application, it would probably be easy to use Emscripten or something to make a web version, if someone really wanted it.