Added more comments and did some minor refactoring.

The tests needed more comments, and I eliminated some redundancies. I
also added the appropriate redundancy to the PBKDF2 test to simulate
different invocations of the same program (keys don't carry over).  I
extracted some constants that I kept reusing.