Collapse directories with only single subdirectory

Implements #19