This patch implements proper simulation of NOR flash, by only allowing flash programming to set bits from 1 to 0, not the other way around. Also did some general cleanup. Simon