As close as it gets -- fixed another bug with character corruption

A kind person have made a public demo of this library (previous version) at work, so you can look at it yourself: http://176.9.227.21/term-ws/shell-ws.php

The JavaScript version has excellent performance (several thousand lines/sec on V8 javascript engine, no noticeable time required to draw programs like mc in full screen) and works pretty well, the following programs work without any noticeable issues at all (I could not find a single deviation from linux console behavior):

htop, mc, adom, vim

There is a bug (possibly?) with white/grey background color in programs like nano/aptitude/man etc, which I believe is caused by code that performs actual drawing rather that by library itself. I suggest spending a little time to look at this port as it eliminates need for python on server and allows creation of quite simple terminal emulators using any server language, even PHP.