Asynchronous SQLite

API is not the cutest but we need it in order to be able to update
models off-mainthread as well (wait for that in the next commit)