issue #18648: replicate enyo's depends function in node

This is an old piece of code from John but it's still useful to get in here, so that we can take it out of vows on the client.