Add work from louh fork

Changes include

* Keep up with recent changes to Jade and Node.js modules
* Some type tweaks.