Add basic commit copy test

* don't assume file_iter is a list (though the parser sets one)
* don't copy inferred name attribute
Test copy-with-replacement and invalid copy

Styllistic fixes, ensure compatibility with pre-2.7 unittest