MDL-46649 gradereport_history: Add apis to get users and user counts
MDL-46649 gradereport_history: Refactor ajax.php to use the new user apis