Added functions to convert between List and JavaScript Array