Added .gitignore and some code cleanup.