Reformat code and update .gitignore