Move state to session variable, continue writing tests