Documentation.
Fixes and start on new JS API.