SQL backend

This will need a while to be ready, but I figure already putting up a PR for code review is a good idea.
Cool. Didn't realize `addCallback` can be used this way :)