Added prune command, closes #463.