First cut.  

This is basically a port of the Node.js support from the Main repo.