idnode: implement sort for simple enums