Move js doc into function themselves.

Then it is possible in the browser js console to get the documentation
interactively.


---- 


I know there is no decision on js doc format, but, when doing interactive test, it is annoying to not get the doc in chrome console. 

This partially fix it by moving docs into functions.