Refactor hashPassword, test it, add benchmarks

The `hashPassword` function now uses a work factor rather than specifying the
iterations directly. This prevents errors since the iterations can only be a
power of 2 anyway.

Benchmarks were also added for all tested functions.