Minor cleanups and redactors

I read more of the idiomatic python book, and incorporated more of what I
learned.
Don't leak file handles all over the shop floor.