added doctest and fixed the doc
refactored cli.py
removed surplus shebang
unified the coding style
refactored program.py