Make morsel_to_cookie more pythonic

Fix a pep8 error. Prior to fixing this, I implemented some tests to cover the code I was fixing. This should help prevent regression issues.