Get rid of the ugly huge array passed to JS as it went over our debug
limit.
(It's a cleaner solution and we get rid of one globals hack.. I just was
avoiding doing to many changes in the original patch, because this whole
interface is not very usable and needs rethinking)