Here's a simpler way. Put this in your htaccess file:
AddHandler server-parsed .js
then add: (function(query_string){
...
})("<!--#echo var="QUERY_STRING" -->");
around your script. This obviously has problems with caching, but it doesn't have the problems addressed with those "heavy loads" that you have with PHP et al.