Better broker errors and some documentation

This merge is mainly meant for passing actual errors back to callers instead of strings. It also has new make target for building jsdoc as well as some new docs in the code.