Added --wipeall.
Some refactoring.