Refactoring and bugfixes

Now repoctl can list all the packages in a repository.