Refactored dialog JS

I largely refactored this to make a very basic change - to make it so that setting `data-confirm-proceed-class` overrides `btn-primary` as opposed to appending after it, as this doesn't style the element correctly, for example, a button with class `btn-primary btn-danger` can end up primary styled, they're not for use in conjunction.

Other than that, this should work exactly as it did before, just a hell of a lot easier to read (I hope!).
Removed unnecessary function wrapping

I am impressed this even worked.
Merge pull request #17 from stevelacey/patch-1

Avoid appending custom proceed class to btn-primary, refactored dialog JS