Web: use JSAProcState.is_valid to validate states

This method is intended for validating states, so it should be
used for this rather than calling get_name and hoping it will
reject states which don't exist.  (As currently implemented,
it raises an exception, so the "if not ...get_name" won't do
what it looks like it would.)
Do not use state codes directly

State codes should always be referred to via the JSAProcState
class.
Web: implement state_prev check on changing state

The prepare_change_state method supplies the state_prev argument
to db.change_state.  However the state_prev value given was
extracted from the database directly before making this change
as a placeholder for checking that the state did not change
since the user loaded the web page from which they are making
the state change.  This has now been implemented so that the
forms which post to this method should now include the previous
state, allowing the check to be performed.
Web: use HTML entity for & symbol

& needs to be written as &amp; in HTML.
Partially revert "Web: css changes to pagination"

This partially reverts commit 3e3440011fd82fc7e0f9d5c4b933372ca88b3c29.

There was already a CSS rule doing the same thing as this.  Having
two rules, with different sizes and one of them (this one) only applying
to some of the links was causing them to move around when navigating
near the end pages.
Web: use JSAQAState.is_valid to validate QA state
Web: add ErrorPage exception class and template

Added an exception class "ErrorPage" to the jsa_proc.web.util
module for representing errors which should be displayed on
a suitable error page.  The @templated decorator catches this
exception and for non-templated methods there is a function
error_page_response available.
Web: use error pages for state change failures

Using the new ErrorPage exception class allows more of the
logic for QA state changes to be moved out of the Flask
wrapper layer.  The error pages should also be more noticeable
than a flashed message, so failures should be hard to miss
when performing a series of QA assessments.