security(passwords): switches password hashing to password_hash()

(replaces #7495)

This gradually migrates users to modern hashes as they log in; deprecates
setting the salt/password attributes in favor of a new setPassword() method
(setting salt/password continues to work but will revert the user to the
legacy MD5 hashing); and moves core password functionality to a
PasswordService object.

Fixes #4665.


Lesson: use @ewinslow's piecemeal approach when moving function bodies to different files; makes review a lot less scary, and can always refactor more later.