This diff is created to separate the functionnal changes of D8687 (curve selection) with the code refactoring it relies on (this diff).
The main idea of this diff is to create functions that initialize all the data required to perform box selections, since both the keyframe-selection operator and the curves-selection operator introduced in D8687 use the same code for initialization.