Implement cookies

*cookie-path-dir* will set where the cookie will go.
*cookie-type* will set what the cookie type should be, which is a choice
 of:
        * cookie.txt format
        * SQLite database
*cookie-accept-policy* will control how cookies are accepted.

/cc @jorams