Add .gitignore entries.
Refactor old Java files.