style cleanups
 - use open file handle in try:
 - Misc PEP8 cleanups
Merge pull request #1 from rread/cleanups

style cleanups.  Use "with open"