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.
Perhaps omit the 'A list...' since T need not be object and promises are not created in this function.  It's just a list.