Refactored cookiejar. Fixed bugs.