fix breaking typo and encode strings

I tried using `{expires: numDays}` in my project with `angular-cookie`.  However, it appears that it doesn't work!!  I just found out that it doesn't work because the `;` is not encoded.  Therefore, none of the options are actually appended to the cookie string.  The browser will completely curtail any un-encoded characters and any characters afterward.  My fix here should address the encoding problem.  What are your thoughts?