Sorting support in beets query mecanism (dbcore)

Add sorting support  (see #749)

 * in the dbcore API and as a new syntax for queries
 * default sort order can be defined in the configuration file
 * documentation and tests case are update accordingly

Plugin-defined Sort objects are not yet implemented but this could be done later (and everything is in place for that).
> the variable = x if ... else z construct does not seem to get much love from python developers ;)

Indeed.

To elaborate: In the case that sort is not none, the original statement is actually a no-op. And that is the whole point of the statement: assigning a fallback value. The alternative conveys that more clearly.