U1db implementation

I think priority now is to get sync working, and implement features like this afterwards. The TODO will remind us of that.