Create subfolders when adding directories

Until now, subfolders of folders were added flatly. 
This change adds folders recursively and creates subfolders within the repository.