Fix typo in a comment
Small fix to cms/grading/ParameterTypes.py
Many small fixes to the DB classes

Mostly comments and PEP8, but also some more serious things.
Small fixes to CWS
Remove cms/grading/AbstractionLayer.py

It was completely unused.
Some changes to ScoringService

- rename the 'submission_ids_*' sets to 'submissions_*'
- drop the token timestamp (and use just the submission id) inside the
  tuples that form the elements of the 'submissions_to_token' set
- don't use lists only to convert them to sets at the end, but start
  with sets from the beginning
- use 'get_from_id' instead of making a manual query
- some whitespace
Improve the 'invalidate_submission' methods of ES and SS

Mostly by rewriting get_submissions to return objects instead of IDs.
Reduce the use of export_to_dict and import_from_dict
grading: some fixes to Job

Add the language to ExecutionJobs too (could be useful in the future for
interpreted languages), sort the fields to give them some sense (the
order should now be the one in which the fields are used/generated
during the compilation and evaluation process) and use an internal
namedtuple instead of abusing the Testcase DB class.

This improves the previous commit.
grading: fix a nasty subtle bug in the evaluation process

The whole issue lies in TaskType.py:237. It's iterating on the numbers
from zero (included) to len(testcases) (excluded) assuming that these
are the Testcases' nums. That's not true in general. Even if we're using
an OrderingList for dataset.testcases we have no guarantee that the nums
form a contiguos sequence (i.e. they don't have holes). For example,
deleting a Testcase via AWS doesn't load the OrderingList at all and
therefore doesn't preserve this property.

The test_number generated on that line is then given to the TaskType
that uses it as the num for the Evaluation, causing troubles for
ScoreTypes during the scoring phase because of mismatches with the
public_testcases.

To properly fix it I decided to make job.testcases become a dict with
int keys. This will not change the syntax used to access a testcase and
will thus make the existing code continue to work, but it will allow us
to give the correct test_number to TaskType.evaluate_testcase.

Note that this bug was NOT caused by the previous commit.
CWS: small fix

The bug was introduced in 2c9a82907b8d11dfc0e9cbaeaabb61201e3f0a13.
AWS: small fixes, whitespace and pseudo-PEP8

Not giving the parameter to the constructor of DB classes already sets
it to its default value: no need to be explicit.

Try to use a consistent style in most of the handlers: start by getting
the objects whose IDs are given by parameters, define self.contets as
soon as possible (as it could be used by the error handler), conclude
with try_commit, redirect differently based on its result (if
appropriate) and put the things "to do" between these two blocks,
separated by blank lines to highlight them.

Move all assignments for the "reevaluation_buttons" parameters together,
to highlight explictly where they're actually used (this becomes more
inefficient, since they're assigned many times with the same values, but
assignments are so simple that it shouldn't matter).

PEP8 states: "avoid more than one space around an assignment (or other)
operator to align it with another". I think this also applies to spaces
after commas in a list of tuples. And, anyway, what we had wasn't a real
alignment...

Remove an unused handler.
RWS: small fix on the client-side interface
sandbox: add 1 to box ID to avoid collisions with console users of sandbox.