More refactoring of the weak-node-api generator
#330
+268
−237
Merged