Text this: Register Automata with Extrema Constraints, and an Application to Two-Variable Logic