move this over ot the command-line interface
Work on #54
work in progress

factored out pinentry and terminal to... someplace else...