backported updates to jli.js from PortableMag...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>