Allow community packages to be uninstalled (plus some refactoring)