Made 'openbazaar' shell script automatically determine install base, removed bash dependency to be more portable.
Fixed sh-syntax issues.
Added the check for local python virtual environment, run in it if available.
Removed unnecessary /usr/bin/env
Merge pull request #1020 from yurivict/develop.scripts

Made 'openbazaar' shell script automatically determine install base, removed bash dependency to be more portable.
Preliminary refactors.

* Fix imports.
* Make lock and logger private attributes.
Setup a context manager for queries.

* Move type registration at initializer.
* Factor a `login` function out of `_connectToDb`.
* Guarantee lock is acquired and released.
* Guarantee connection is opened and closed.
* Silence pylint errors; the decorator is not meant to be used as an
  instance method.
Execute queries inside the context manager.
Drop old connect/disconnect utilities.
Fix and elaborate docstrings.

* Also have the Connection commit after each operation.
Merge pull request #1023 from Renelvon/refactor_db_store

Refactor db_store using context managers