Got the basics working
Cleanup and initial cookie check