make foldHashes iterative

Also change instances of []*siacrypto.Hash to []siacrypto.Hash
proofStack length no longer needs checking