pkg/index: cleanup, refactor sub pkgs

http://camlistore.org/issue/263

Change-Id: I319bb097f0ce30b2bd5271b5c3bbff92b8dcc318