Code clean-up and move some magic numbers to enumerators as well as add some documentation
Also fill the target orientation field when selecting a row
Also set formState to FormState.FormStateMain if the expanding was instant