load js libs in reverse order of vis inheritance

if visualization V1 requires the javascript library A and B, and
inherits from another visualization V2 which requires the js libraries
C and D, the js libraries are loaded in order C, D, A, B.
changelog