Change defines into enums

These are conceptually enums, so they should be so in code as well.