Add preBuild hook for addons (Resolves #2410)

This creates a preBuild hook for add-ons, based on the work that was done for creating a postBuild hook. #1215

As noted in #2410, an example use case for this feature might be when there are file checks or manipulations you need to make prior to the build process.
I think `postBuild` should always be happy path (non failure) because the addons expect the directory to be provided, but definitely agree that we should add a `buildFailed` hook in a `catch`.

I also, think that this PR adds the proper foundation, and we can add `buildFailed` subsequently.