Issue #1574484 by tim.plunkett, nod_: Replace authorize.js with states.

PR for https://drupal.org/node/1574484