Fix gpg_open close behavior to wait for gpg to terminate
whitespace
Further refactoring of search result json
Updating tests and fixing buglets after refactor