fix gpg() for python 3.2 by close_fds=False
add python2 support, add test script to run tests with python2 and 3
open /dev/tty once per session
update single quotes to double quotes