Tidied up cookie methods a bit. Added getCookie which is not in the wire-protocol, but is quite useful.