Update tests for changes from user_agent_header to user_agent.
Change user_agent_header to user_agent. Tighten up implementation.