Fixed correctness error in hash-impl.h

An off-by-one error would cause the Keccak-f permutation to be applied twice to the sponge prior to squeezing for messages of length byterate - 1.
Fixed up test infrastructure somewhat; corrected some build errors.
Reformatted; some build changes.
Formatting; fix to keccak.h