Code for simulations and figures of http://arxiv.org/abs/1309.3256 .