restructures ws frame handling
corrects ws frame bit masks