Add a .gitignore
Add basic command line option handling, clean up code somewhat