Inserts multiple-iterations into the integrity-check routine

Running the tests now takes 125% more. To configure the number of iterations,
check the settings.py file. It's set to a relatively low value (1000) in
order to make the tests fast enough.