Add objects_per_type api
This permits to reuse the same logic for different clients (loader-dir, loader-tar, loader-svn)
(Tests were lost)