Convert the cookie object to its JSON representation before storing

This fixes #63 and closes #75.

Added tests for non-stringified setting of expire.

Also fixed a little bit o' spacing.