Login API

Revamped the User class after meeting with Keith yesterday.

Added Organization class.

Made User and Organization classes JSON serializable (not actually as
we're targeting PHP 5.3 not PHP 5.4 -- must call ToArray() function).

Added LoginResult class for graceful handling of login result
encapsulation.

Started implementing router pattern in main.php.

Implemented hooks in main.php for JSON API support.

Implemented API router.

Implemented login API (see api_login.php and api.php for documentation).