AutoloadGenerator: Refactoring, part 1.

AutoloadGenerator currently has some "problems" with code quality:
- The dump() method is very long.
- All methods have a crazy number of parameters.

This is an attempt to improve this.
It might not be the best (yet), but at least a start for some discussion..