Refactor CI variable list code for usage with CI/CD settings page secret variables -- EE merge edition
EE merge edition of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16729
EE merge edition of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16729