Highest Write Wins flag, register, map and set

*Only for discussion not finished yet*

`state` should perhaps be private?