Refactored debug session handling to limit code duplication
Refactored debug session handling to limit code duplication

jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab