Autodetector rewrite

This is an entire rewrite of the autodetector to be more extensible and actually contain things like logic and computer science rather than just throwing things into lists in a rough order and hoping.

All current tests pass, but I want to make sure it matches what people expect too before merging.