mediawiki.cookie: Implement expiry option as time from now
The current option (Date object) isn't user-friendly as it requires
users to construct a Date and set the time offset accordingly.
They likely do that using an offset, not an exact date. Optimise
for the common case by supporting this directly (similar to the
server-side cookie expiration logic, as well as our ObjectCache
classes and other systems).
Support for exact dates is kept as this is still useful for the
native transport layer where timestamps are used. But the API
surface now supports durations as well.
Note that there was an undocumented fall-through of options.expires
as number of days. This is implemented by upstream jquery.cookie
and mw.cookie previously didn't recognise or reject this value so
it fell through.
Change-Id: Ia2e51d3a3e4d19484367cb74003c4f756c87345d