JavaScript module API changes

Change-Id: I1b215c584c38989c697d93790702c47abb74541d