Rewritten the autoloader so it can also autoload models.