Changes to API and Query tools

Update the query tools library so that the
main database url is in get() rather than
spread out elsewhere. Then other methods just
pass in the resource they are querying
(eg image, or instrument) and that is appended
to the url.

Add a post method to posting new items to the
database. It returns the URI that was created
(if the API is set to include it)

Add authorization field to the resources we want
to post to (NB no security yet!)

We need the resource API in order to reference
any foreign key objects when posting a new
object (eg, to post a new image we need a
reference to an instrument, region and
measurement type). This requires us to change
include_resource_uri from False to True in a
the required resources so that we can retrieve
the URI from a query.
Add "get or post" method

Add a new method to simulate the
"get or create" django method - it
does a get to see if an object already
exists with the search parameters, and
if not posts a new object. In either
case the URI for the found/created
object is returned (or None if the
resource API doesn't return the URI)

If get returns more than one object,
an exception is raised.

NOTE currently only works for simple
models, not ones that refer to
foreign keys (since the way those are
searched is different in post and get
syntax)
Add supersensor images to database

New method to add the recalibrated images
to the database, under a new supersensor
instrument.

We use libquery.Querydb to post the data,
instead of using the django commands so that
it is not dependant on always using django
for the database.

Note that currently there is no mechanism to
stop multiple duplicate images being posted
(instrument uses Querydb.get_or_post which
prevents duplicates, but it can't currently
cope with foreign key fields)