remove all unused imports in cli.py
make the code a bit more testable
hang on: more testable code comming ...
add test method for do_edit