Added autoloader interface

Converted the autoloader to use a common interface to improve testability