readability edits to patterns & message handling

also removed some debug prints

parse_messages returns an dict with type: None by default so that it's
safe to check the ['type'] key without get()