Refactor recurisve module compile with promises

Refactored recursiveModuleCompile to return a promise, with some other simplifications targeting ease of understanding.

Refactored other code that uses recursiveModuleCompile to use a more natural promise style.
Using Promise.all instead, as it seems that order of evaluation/completion doesn't matter here. If this isn't the case, I can change it to use sequencePromises instead.

In other news, I found out that this function is not covered by the current suite of tests. Do you want me to add a test for this, or do this in another pull request, or is it okay for now?