After a bit of haxing tonight I have the skeleton object layed out, and the initial serial->protocol logic defined.
I am now basing this entirely off the avrdude implementation for simplicity sake (its a lot easier to read).
The jsSTK500 project is hosted on github here.
NOTE: This is completely untested code as I dont have an arduino down here to test with while im hacking on my laptop downstairs :)