Update domain parsing for cookies

Now excludes hashes, query strings, and anything after the first
slash when setting a domain for a cookie that is missing one.

Fixes #78.