Added $cookieStore and $cookie; some code and tests reorganization