remove docopt.py, tidy documentation, tidy code