Add operation to translate foreign keys between data sources
Merge pull request #27 from anchor/wip-mappings

Add operation to translate foreign keys between data sources
Rework Retcon.Store interface

- Implement new interface "token" values and type classes.

- Rename operations in existing RetconStore typeclass to make way for
  the new operations (renamed ops will only be used in implementing
  the new ones anyway).
Large, partially complete refactoring

Probably doesn't even compile.
Storage actions now in the custom monad
Formatting
Fix (compiling of) tests

All test suites build again. They don't (all) pass, but they do build.
Make handler tests green again
Remove an extraneous initialise call
Create test suite for PostgreSQL storage backend
PostgreSQL storage backend tests

Expand test suite for PostgreSQL storage backend and fix a bug that
expanded coverage detected.
Add more PostgreSQL storage backend tests
More tests for PostgreSQL
Add a [failing] test for PostgreSQL diff storage
Storage and Monad API refactor

Some (possibly most) data sources will, in practice, need read-only
access to the retcon storage API so that they can, e.g., translate
identifiers with which they reference other objects as data comes in
to the system. This is, by design, almost impossible with the current
architecture, which uses two different monads to isolate the data
source actions from the handler API.

This series of changes refactors essentially all of the things, with a
view to:

1. Split the storage API into read and write fragments.

2. Implementing a new monad which will, in due course, subsume both
RetconHandler (in this PR) and DataSourceAction. This new monad is
indexed by a "token" which can be used to access specific sets of
operations on the retcon data store; Handlers will have a read-write
token and Actions a read-only token.

3. Change the types on several core API functions to simply operation
(storage-related functions are in the unified monad and use the values
which index for access levels rather than taking a "handle" as an
argument).

Some additional, only tangentally related, changes which were
convenient to do at the same time:

1. Remove all trace of PostgreSQL-specific code from the main
test-suite (indeed, this suite runs using in-memory storage now). This
is heaps faster than creating and dropping a database 16 times!

Once merged, additional work will build on these change:

1. Remove the functions which "wrap" the storage API as handlers.
These were convenient when the storage API methods were in IO, but now
that they are in the new monad, these functions almost all do nothing
but re-call the wrapped function.

2. Revise the types for data source actions to be in the new, unified,
monad as described above.
Remove now-unnecessary wrappers around storage operations
Moved diff storing SQL to PostgreSQL store, changed schema, tidied up tests
Make lint happy
Added a method to dump the Retcon database and added it to some of the tests
Added sorting to ensure consistency in test results