fix scope on anon funcs for cron callbacks on index documents and set en...

...dpoints hooks