Fix byte compiler warnings about free variables and functions and do some minor cleanup.
Add .gitignore