Cleaned up the code, added a waitDialog option for wait dialogs instead of using 'none'. Added allowHTML to be able to add HTML icons to the buttons.