Convert test variables to the state system.

PR for https://github.com/backdrop/backdrop-issues/issues/163