Move cookie parsing/building code to cowlib

The code for parsing has also been rewritten to be more efficient
and to be able to handle cookie values with space inside them properly.

Update cowlib to 0.2.0.