adds cookieManager for cookies and tweaks core.js for some bugs.