Applies some more refactoring. Moves event ioctl definitions
into ioctl.go