Ico's nw.js 04x patchset
This recreates Ico's nwjs-0.4x patchset on a separate branch, so that work can continue there. To be merged into the new icon-nwjs-04x target branch after merging !407 (merged).
Note that this just reinstates all changes which were reverted in rev. 158cc991 from !407 (merged).
@jwilkes I can't merge these myself, so you'll have to take care of that. :)