The distribution of the divisor function in arithmetic progressions: Basics, surveys, methods, second moments, new results