Query API

Added the ability for user information to be queried via JSON.

See controllers/api_query.php for API documentation.

Made several additions/modifications to the Organization and User
classes to both add new functionality (required for the API) or to fix
bugs/inconsistencies.