thumbnail generation and disk caching

and, as an aside, move generating preview thumbnails for drafts off the main thread
I think that's a holdover from the Android database format.