add support for postgres datastore

This pull request does a few things:

  1. Defines a `GearmanDatabase` base class
  2. Converts the old sqlite code to an implementation of a `GearmanDatabase` (`SQLite`)
  3. Adds a `Postgres` implementation of `GearmanDatabase`, and makes it the default (and currently only) option
  4. Adds tests for the `GearmanDatabase` interface, testing both the `Postgres` and the `SQLite` implementations
fixed and rebased