command-line: use external lib to bind keys
misc: simplify selection of DOM
command-line: fix checking history

it was droped previous PR
repo: добавить валидаци существования ветки