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>
Style change

Signed-off-by: Simon Luijk <simon@simonluijk.com>
Add note about current approach of detecting aac vs alac

Signed-off-by: Simon Luijk <simon@simonluijk.com>
Fix Python 2.6 compatibility
Replace two more flag arguments
Display album disambiguation information in order of common importance. Media, year, country, label, albumdisambig.
Quick fix for a couple other places that were expecting hooks._album_for_id()` to return a single result.

It's possible that these plugins might require a little more thought
into how they should work (or not work) with potentially multiple albums
matching an idea, and potentially those those albums being an incorrect
match (e.g. if two data source plugins share a simple numerical ID
format).
Merge pull request #298 from jayme-github/python26-resub

Fix Python 2.6 compatibility
Lay out beatport plugin based on discogs plugin
Implement Beatport API wrapper
Fix Beatport source weight
Implement BeetsPlugin API for Beatport plugin
fix interface to ID matching

As outlined in #299, we broke many places in the code that were expecting
_album_for_id and _track_for_id to return a single item rather than a list. I
took this opportunity to divide up the interface: there's now one function for
MBIDs (returning a single object or None) and one for generic IDs (returning a
list).
zero: fix nulling fields containing None
Merge pull request #295 from simonluijk/alac-support

Initial support for ALAC encoded audio files
merge
changelog/thanks for ALAC (#295)
add tests for ALAC (#295)
Use a Distance object instead of floats for distance calculations.

The new Distance object knows how to perform various types of distance
calculations (expression, equality, number, priority, string).

It will keep track of each individual penalty that has been applied so
that we can utilise that information in the UI and when making decisions
about the recommendation level.

We now display the top 3 penalties (sorted by weight) on the release
list (and "..." if there are more than 3), and we display all penalties
on the album info line and track change line.

The implementation of the `max_rec` setting has been simplified by
removing duplicate validation and instead looking at the penalties that
have been applied to a distance. As a result, we can now configure a
maximum recommendation for any penalty that might be applied.

We have a few new checks when calculating album distance:

`match: preferred: countries` and `match: preferred: media` can each be
set to a list of countries and media in order of your preference. These
are empty by default. A value that matches the first item will have no
penalty, and a value that doesn't match any item will have an unweighted
penalty of 1.0.

If `match: preferred: original_year` is set to "yes", beets will apply
an unweighted penalty of 1.0 for each year of difference between the
release year and the original year.

We now configure individual weights for `mediums` (disctotal), `label`,
`catalognum`, `country` and `albumdisambig` instead of a single generic
`minor` weight. This gives more control, but more importantly separates
and names the applied penalties so that the UI can convey exactly which
fields have contributed to the overall distance penalty.

Likewise, `missing tracks` and `unmatched tracks` are penalised and
displayed in the UI separately, instead of a combined `partial` penalty.

Display non-MusicBrainz source in the disambiguation string, and
"source" in the list of penalties if a release is penalised for being
a non-MusicBrainz.
Bugfixes in Beatport plugin