Add button creation function.
Extract buttons to leap.widgets.js.