rebased on charybdis v2 branch
adds support for charybdis to accept cookies as a JSON array