(PUP-844) cleanup autorequire file

This makes what autorequire is doing more readable by shortening the branching
and removing some extra checks on the length.