As part of this, clean up the duplicated code where each writer independently
implemented the effects of --enable-optional-components. Also, clean up the
pseudo-isinstance() in case I find I need to add OptionalLibraryGroup later.
Just to give you some context and an overview of the direction, we have some hacks we use to make our LLVM dylib smaller by omitting subcomponents of LLVM that we don't actually use in practice. This is part of a small series of patches to try to eliminate these hacks by rounding out llvmbuild's support for optional libraries. This patch allows libraries to be included by default and optionally disabled, and it will be followed by a small bugfix for --enable-optional-components, and then the addition of an optional_libraries to go with the existing required_libraries.