Code reorg, cookie parsing and CORS.