improved gpg_program and tests for it