Sort ports; simpler (and more robust) workspace clearing using ipyton %reset_selected magic