Refactored cookiejar. Fixed bugs.
Refactored cookiejar.