fix callbacks as optional in js kernel.execute

plus some doc fixes.
Mainly to fix some backward compatibility with examples here and there.
Typo : optionnal -> optional
Merge pull request #3294 from Carreau/jsfix

fix callbacks as optional in js kernel.execute