Add .gitignore.
More cleanup in main module.
test_cmdline: adjust test to new behavior.