Added json as an option for cookie serialization

Addresses issue #36 (which in turn addressed issue #35)