Fix test failing when run close to the end of the day.
Prefix `gid`/`sgid`/`global_id`/`signed_global_id` with to_.

This prevents clashing method names. For example apps modelling file system
permissions might have a group id aka gid accessor.

This also clarifies global ids as a conversion like `to_s`, `to_a` etc. methods.
Encode expiration as iso8601 in UTC timezone.

Allows subsecond expirations to be encoded, which would be helpful for
something like API requests.

This also ensures a specific encoding format for timestamps. Previously
the encoding was left up to the serializer which might not roundtrip
time like objects.