Update aguid generation to create cookies compatible with nginx userid [MJ-480]

Makes aguids compatible with the cookies generated by nginx; If we didn't do this, nginx would clobber anything that didn't match and replace it with a new one.

All tests pass.