Use a different format for ContestExporter/Importer

The new format isn't "tree-like" anymore but, instead, it's a dictionary
whose values are all exported objects and whose keys are the associated
IDs. The IDs aren't the ones they had in the DB before exportation nor
the ones they will have after importation. They're IDs whose scope is
just the one of the exported data, and they're global IDs (unique among
all classes). This allows us to export complex relationships, and not
only trees. Moreover we are able to write a general method that does
this for all classes and all relationships, avoiding the hacks we used,
for example, when exporting submissions.

With this commit ContestExporter doesn't use .export_to_dict() methods
anymore and ContestImporter doesn't use .import_from_dict().
Rewrite YamlImporter
Rewrite YamlReimporter
Remove all specialized export_to_dict and import_from_dict methods
AWS: Log some generic exceptions to aid debugging.
AsyncLibrary.py: Aid debugging by printing tracebacks over RPC.
DB: add Dataset
DB: add SubmissionResult
DB: add UserTestResult
DB: enumerate_files
DB: get_from_id_or_create

Add helper functions to lookup, and if necessary, create
SubmissionResults and UserTestResults.
DB: get_submission_results and get_user_test_results

This is a more efficient means than loading each submission or user test
and its results separately.
DB: Add UpdateDB script for task-versioning changes.
grading: Job
grading: get_task_type
grading: get_score_type
grading: ScoreType interface
grading: Fix more places where SubmissionResult must be used.
grading: Add support for dataset previewing and notifying students of changes.
services: update get_submissions to get_submission_results