Clean up code and add .gitignore.