group JS globals in "globals" dict
prune old unused pool cmds

voodoo voodoo!
fix fmt string for cmd id (%s -> %d)