compatibility with sha512

These changes add support for sha512 hashing algorithm. This is often required for compatibility with applications that don't support bcrypt.

I am far from an expert on this level, but these changes work fine on our setup. What are your thoughts?
I don't think either of them should be rewritten. In the password_hash() function we're just setting a default value but afterwards checking the value provided in the $options array for validity. In password_needs_rehash() we're effectively checking if the rounds (or cost) in the hash needs to be changed.