Clean up client packet handler, using descriptive enums instead of "magic constants".