fixed several issues with variable overwriting. Added button defaults. Added updateContent function. Added closeOnClick setting to buttons
improved example substantially