Hi there - great that you're working on this.
First, if you want to go back to the original method, i.e. using the 'html' format in the database, you can make your viewer take precedence over qa_viewer_basic by returning a value greater than 1.0 from the calc_quality(...) function in your viewer's class. Of course you should only do this if the $format parameter you're supplied is 'html'.
Second, the get_html(...) function in a viewer class can't access the global $qa_content variable, since it's not passed a reference to it. Instead, you can embed the Javascript load inside a <SCRIPT...> tag within the HTML that is returned by your function. Also, when buliding the URL for this Javascript file, you should start from the relative URL that was passed to your module's load_module(...) function to ensure it works on all pages. And finally, make sure you only enter your Javascript tag once per Q2A page, since your viewer could be called multiple times for multiple answers. A PHP global variable can solve this for you.
Hope this helps - feel free to ask any more questions about this.