Updated jquery validate plugin to version that works (ready to merge)

There's been an issue with the old version of jquery-validate that fails when using spans as error labels. The effect is that error messages duplicate, since there is no "for" attribute to signify an existing error message attached to an input field. A fix is pending at https://github.com/jzaefferer/jquery-validation/pull/1083, but for the mean time we can merge in an updated version into userforms, and refresh this version at a later date.

I've also stripped out the javascript generation logic into the template, so it's a bit more accessible to other modules / users who wish to update the default script (they can just override that template). It also increases the readability of the code a great deal.

[ref: CWPBUG-110]