Modularized trim-nodes.js