Separate and refactor injection.

This separates injection into a separate method and adds the ability reference client script bundles as a part of the injection process.