Updated Javascript converter to handle reference types.