Only expose functions if shouldExposeFuncs
Replace for each...in with for...of