Add .gitignore, brush up IO functions.