Moved common button and toggle button functionality to macros
Updated examples for new button api