Fix writing output event tree if it is in a subdirectory; add a test for that.
some trivial code and .gitignore cleanup;