totaly refactored and leave in commander.js just generation of json of directory listing