Let's have one canonical place to define ResultCode instances and their labels. Also make ResultCode's `__init__` function self-registering to better support custom ResultCodes.