MODE-2290 Corrected use of indexes for criteria with aliases and bind variables

Corrected the way that indexes are planned for criteria that involve aliases and bind variables. Also added several new tests to verify the expected behavior.
Merge pull request #1233 from rhauch/mode-2290

MODE-2290 Corrected use of indexes for criteria with aliases and bind variables