How to return Grades?
Well your plugin will need to implement the gradebook APIs from Moodle. That will happen in PHP, so you will need to post grades up to your plugin, probably in an ajax way. And your plugin will use the gradebook APIs to tell Moodle about those.
Grades and Moodle
AJAX and Moodle:
Not sure its simple, but the minilesson plugin does the same kind of thing you are doing, and the code there looks like this:
processing that in PHP when it arrives
Using libraries from CDN
I just put the full URL of the CDN lib in the AMD declaration. The lib needs to support AMD though.