Fix the way primary statements are stored in the DB

Use a JSON encoded dict to store the preferred statements for a user
(now called "primary"). The keys are task names and their corresponding
value is a list of language codes.

For symmetry, allow a task to specify multiple primary statements, too.
Export token_gen_time as the number of seconds, not minutes

The only reason to do it is to uniform the code.
Remove some useless single_parent arguments from DB relationships

The single_parent argument for relationships is needed to make
many-to-one or many-to-many relationships become one-to-one or
one-to-many. It has no effect on relationships that already are of the
latter types. Yet, it was used on many backrefs which, usually, were
one-to-many relationships. These occurences have been removed.

The only remaining use is for tokens: it is needed to prevent
submissions from being associated with more than one token.
Clean up the cascade argument of relationships in the DB model

The "delete" option can be removed since it's implied by "all". The
"delete-orphan" option can be removed too because it will never be
needed, since all relationships rely on a NOT NULL FOREIGN KEY column
which will always refer to an existing object (also thanks to the ON
UPDATE CASCADE and ON DELETE CASCADE clauses).
Add passive deletes

Since we have set a ondelete="CASCADE" option on all foreign keys we
don't need SQLAlchemy to *load* and explictly delete all children when a
parent is deleted (because the database will do that automatically).
The passive_delete option does exactly this.

The passive_update option is the same but fot updates. Yet, it's True by
default, so we don't need to set it explicitly.
Use a uniform coding style for relationships in cms.db

That is, use a hanging indentation.
Clean up some imports in cms.db
Various fixes
__init__: Define a powerful Base.__init__
__init__: Set reasonable default values for column properties
__init__: remove all specialized __init__s

Warning: this commit breaks a lot of things!
__init__: make all code use the new __init__ syntax [TO REVIEW]

By fixing the order of positional arguments, using keyword arguments
where needed, etc.
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
ID. The ID isn't the one they had in the DB before exportation nor the
one they will have after importation. It's an ID whose scope is just the
one of the exported data, and it's a global ID (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(). They could
theoretically be removed, it there weren't YamlImporter, ES and Worker
using them (inappropriately).
List better the modules we're exporting in SQLAlchemyAll
Remove useless methods
Resolve circular dependencies in cms.db
User model. extensively
Split relationship+backref into two different relationships