Use attr instead of NamedTuple to generate SWHID.
As NamedTuple inherits from tuple, msgpack serializes it like a tuple, which makes it indistinguishable from a tuple when deserializing, which is an issue for the RPC API.
Migrated from D3450 (view on Phabricator)