Add in .gitignore.

Delete .hgignore and carry over ignoring .pyc and emacs tmp files.  Add
exclusion rule for emacs #foo# files.
Cleanup existing code to meet coding standards.

@cstanfill, I am so sorry if i have damaged your library.  But the `for` stuff
was really bothering me.