Style and organization fixes.

* Moved hooks into class with static functions.
* Removed function visibility for inherited functions.
* Added spacing before if(.
* Moved TwoFactorUser.php into main folder since
  it's not an external library.

Change-Id: Id9b595471f75c265bed8e9771864451326c39464