DB: re-raise database errors as our error type

This prevents routines from having to know which database-specific
error types to expect.
Schema: add unique indicies on job_id and filename

This is to prevent the same file being listed more than once
as an input or output for a given job.  In general for the JSA
multiple jobs may share an input or output file, even though
that isn't the case for the SCUBA-2 HEALPix processing we
plan first to use this database for.
DB: add state argument to add_job method

The method includes a check to see if the state is valid.
CADCDPState: use our exception class

Now raises JSAProcError instead of a plain Exception if the
state is unknown.
CADC: add method to parse the parameters string

This extracts the mode and "drparameters" from the parameters
string as stored in the CADC DP system.
test: factor out creation of dummy database
CADCDPState: add name lookup method
Use absolute imports
Add routine for initial import from CADC
test: extract dummy CADCDP class into a new file
Add intial version of state machine class

This includes a method to poll CADC for the status of jobs
running there, and a dummy implementation of a method to
go through the status of jobs being run at JAC.
job_running: add basic job validation checks
DB: correct documentation regarding input files

These are plain file names rather than pathnames.
DB: correct spelling of identifies
DB: check new state is valid in change_state

This caused the existing database test script to fail because
it used a state which doesn't exist.  Also added a new test
to make sure invalid states are rejected.