Revert "Greatly simplify autoload"

This reverts commit 229ec91319777cceb3903b7f15432d941ec659a5.