Very interested to see how that goes. I think it would be key to figure out what sort of JS ought to be compiled like that, and which stuff shouldn't be. There'd need to be some way to tell it to compile or not compile a piece of code.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Sounds great, I hope I may be able to give it a try during the weekend!