Removed some confusing code in msgs.py

the code was essentially a state machine, but was using soem magic
values and comments, changed this to an enum-type class (as to not break
backwards compatitbility)
also removed potentially unused variable i