Nicer DB query interface. Doesn't compile, WIP.