Patches, Namespace and PSR2 conversions

Moving more core to namespaces, and some minor cleanup.

Also, add self updating password hashes. If an old or obsolete password hash algorithm is detected on successful login, the password will be rehashed with the current prefered algorithm.