Refactor to use a consistent file format in all functions; separate copying and converting

The refactoring conveniently forced me to adjust filterRepresented.

Fixes gh-8
Fixes gh-9