pkg/search: generic queries for camliRoot and 'child to' relation

Start using them in the publish handler, to ease the move to a
possibly stand-alone publish handler.

Context: http://camlistore.org/issue/365

Change-Id: I2781a345e024174e3bea8511b6cdc6f342d5a7c1
edge in corpus

Change-Id: Ifbce08090f2ae8210d39988ff4cd89cca9630ca4