cleaning up to pass rat checks

* adding missing license headers
* excluding test data files
minor cleanup
resource leak in unit tests