Update so it works with the latest version of Gravity forms

I've updated the code so the variable set with Gravity forms is reset on failure.   This means that if the submit fails you can actually submit a second time.

Also done some minor code cleanup and disabled debug mode.