Support multidimensional lists to javascript

See #1939