begin database refactor: move Model to new module
new Database class in dbcore

This moves most of the abstract Library functionality. Much more to come. Some
stuff is temporarily broken, to be followed up on in the next few commits.
move database_change events back to library.py

dbcore is abstractable. Should not depend on any beets internals.
move basic queries to dbcore

I don't yet know where to divide the query hierarchy: maybe we even need a new
"queries" module for all this.
fix some mistakes introduced during refactor
new BytesQuery factors out MatchQuery's path logic
dbcore: subsume schema setup, add Type class

Type will also include fields for parsing, emitting, and querying a given
type.