Tease the file / folder iteration apart from the route handlers into a helper lib (this can be tested later etc)