The IDE is built on top of a window-tiling manager abstraction we built in React.js: https://blog.repl.it/ide
Now, as for languages, most of them do run inside the container, which is built from our base image polygott (https://github.com/replit/polygott). However, a select-few are better suited to run on the client. We have a client-side jail called: replbox (https://github.com/replit/replbox). Basic, for example, runs on replbox because I wanted to graphics to be instant. For something like PyGame or LOVE frameworks we had to go with VNC streaming but that's not ideal for obvious network reasons.
There is a lot more to it -- it sometimes feels like building an entire city -- and you can find some more posts on our blog: https://blog.repl.it/ (which incidentally is hosted on Repl.it).