Refactor line handling in mdb shell
Add general tests for metadebugger shell