refactor(*): pull out common selector logic

Each directive uses the same selecting logic for the different angular functions
refactor(*): modify test framework and selector functions