Add .gitignore. Some source code cleanups