Prepare code to bundle with state, prepare for CSRF.
state is now required for CSRF.