Removed require('directory'), added getChildren function body.