Javascript api 484

Makes a basic JS API for the toolbar.

Closes #484