Split files in subdirectories

Coauthor: Rafal Remisiewicz