3470: Refactor analytics JS for clarity
3470: Refactor analytics JS for clarity

Authors: d5ccab9765fb47306b3cd91684c6e305740cceb7@lloydnye

alphagov/verify-frontend,alphagov/verify-frontend,alphagov/verify-frontend,alphagov/verify-frontend