fix handling of existing non-expr <s-tab> mapping

also remove some code duplication

fixes #123