add support for filesets, with some attendant refactoring