Fixed bugs in analysis script

- Changed exit() to sys.exit()
- Gracefully dies when given invalid filename
Added gitignore, removed pyc files.