Rework file handling to separate files per-chan

In this way each channel is mapped to a directory