b4a.js: added a bunch of docs and cleaned up some minor issues from jslint