move dbterm stuff to later in the file

I thought about getting rid of it since it's equivalent to something
purely in terms of db. But that's probably not worth the effort.