Began writing wrapper functions for queries. Only topitems() is really "done" at this point.