[libsocialcache] Optimize image downloading.
[libsocialcache] Make thread management an internal detail of databases.

Hide most of the details of threading, database initialization and
locking away in AbstractSocialCacheDatabase and instead offer some
simple read and write virtuals within which the work can be done.

Simultaneously change from a model of dynamically generating queries for
each write to simply using static queries that are prepared once and
kept in a cache for re-use in subsequent writes.

Combined these changes reduce the total number threads used by
internally utilizing a thread pool, and cut down on time spent compiling
sql queries.
Merge pull request #29 from adenexter/thread-reduction

[libsocialcache] Make thread management an internal detail of databases.
[libsocialcache] Allow multiple models connected to one downloader

Previously, one image downloader could only be used with one model
at a time.  This commit fixes that issue.
It also removes usage of file.map() as it would warn about mapping
greater than filesize being unsupported on some platforms.
Finally, this commit doesn't download full images until they're
requested, to save data and reduce the time it takes to load
thumbnail files by a huge factor.
Merge pull request #30 from chriadam/fixnext

[libsocialcache] Allow multiple models connected to one downloader
Bump the lib version
Merge pull request #34 from nemomobile/next

Merge next into master