discogs: penalty only for matches from discogs

Otherwise, this was penalizing all album matches.

This also applies the same treatment as the previous commit: only load the
config at run time (at the expense of code clutter).
fix some docs syntax
back out source-sensitive sorting

This is now addressed by a distance penalty.
refinements to artpath modification patch

That's 371cc72f2d09 in hg. This makes the patch slightly more general by
reusing our type conversion infrastructure. It also uses "bytes" as a synonym
for "str" that I find a little bit clearer.
discogs: move config default into constructor

Such is the new convention for plugin configuratino defaults.
fix some dumb mistakes from most recent flurry
distinguish Album and Item template fields

An earlier change (due to @pedros) added the ability for plugins to define
template fields that work with Albums as well as Items. This enables some
cool new use cases but required that every template field definition check the
type of its arguments. Instead, this iteration on the idea distinguishes
between fields meant for Items and those meant for Albums.

In addition to simplifying the implementation of these functions, this also
enables the creation of album fields with identical names to item fields.
(For example, a user contacted me recently about adding a $bitrate field for
albums, which would be the average bitrate of the items. They can do this now
using a plugin.)

I also changed the docs to stop using the decorator approach to registering
template fields. We're moving toward removing those.
inline: allow album field definitions

Under the album_field heading.
inline: rename "pathfields" to "item_fields"
fix for undefined TRACK_LENGTH_GRACE

Thanks for catching this, @mrmachine.
Return a list of candidates in hooks._album_for_id
Improve regular expression for Discogs IDs
Fix bug in discogs.album_for_id for ID-Strings that end in a bracket
use album template fields in item templates

This lets you use, for example, the example album bitrate field in path
formats.
Make regex for Discogs ID more specific
Initial support for ALAC encoded audio files

Both AAC and ALAC are normally embedded in an .m4a container. For
this reason I have split the m4a type into aac and alac types.

To distinguish between the two encodings I have taken advantage
of the fact that, in my collection, ALAC don't have a sample_rate
set. I could not find verification if this is always the case
or not. Would bitrate be a more reliable determining factor?
e.g. if bitrate > 320000: type = 'alac'

Signed-off-by: Simon Luijk <simon@simonluijk.com>
Merge pull request #291 from jbaiter/discogs_albumid

Support for manually entered IDs in plugins
fix tests for ID parsing (#291)

The previous tests accessed the network. This refactoring lets us test the ID
parsing in isolation.
#291: simplify plugin interface for album_for_id
#291: restore shortcut for manual ID searches