Strict fix

Make cookiejar compatible with strict mode and fix global leaks.