Refactor DBcore without changing behaviour

This PR contains some of the refactoring from #919. It extends the `Type` API and clearly separates responsibilities. The new API allows us to remove a lot of similar code.

For a review I suggest to first look at the final [`types.py`](https://github.com/geigerzaehler/beets/blob/dbcore-refactor/beets/dbcore/types.py) file and the changes in the [model implementation](https://github.com/sampsyo/beets/pull/959/files#diff-1), modulo the changes in 19d3ca822ef539ac99ec9143d97e625c34c94516. This will get you an overview of the goal. Then each commit should be reviewed. The changes are atomic and should leave the behaviour of the program unchanged.
This is certainly true for the TEXT column affinity, but if we go with NONE we do have the opportunity to avoid this round-trip. Of course, this opens the door two a whole new set of problems caused by storing different types in that column.

Should we just switch back to TEXT and use this stringly typed translation? I like this design, even if it does require lots of serialization/deserialization round-trips, so I'm inclined to say yes.