Add parse_cookies and make some utility functions