Further refactor the BundleAutoloader class to simplify unit testing