Revert "Changed to registerBuildPlugin and removed Package.onUse"

This reverts commit 9e38162f2117071aa84860d8fd42be24aa174f2b.