Add option to specify alternative js initialization function