MDL-46569 gradereport_history: Use table_sql for the report

This patch includes:-
- Converted the code to use new renderable/render apis
- Rewrote the code to remove all custom sorting, etc and use table sql instead
- Usernames are now clickable
- Grade items are now clickable
- Grade history is now displayed even if the grade item is deleted
- We are now using table sql for downloads so export in multiple formats is supported
- Feedback is now properly formatted