Gulik's reply reminds me that you might find the code that allows the VM to be a browser plugin instructive. Part of your interest will likely be that there is so little needing changing.
I'll leave it to John McI to explain the details since he's probably done most of the code fudging involved.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Never write software that patronizes the user.