Clean up hash code and add PBKDF2 tests.