Refactor template selector JavaScript
In preparation for changes to template selector logic in %9.1, this MR refactors files related to template selectors to use the update syntax for class and modules.
No substantive refactoring was intended here. The goal was to make these files easier to work in by way of cleaner syntax and uniform structure.
Summary of changes:
- Move files related to
TemplateSelector
into a sub-directory withinblob
directory. - Refactor all files to use ES6 and module loading syntax.
- Improve method naming in
TemplateSelector
- Remove unnecessary context assignments with
bind
- Update references to these files elsewhere in the javascript codebase
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9782 will be based on refactoring in this MR.
EE Compatible MR: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1496