Rework id class to gain more control on serialization and parsing.