Cleanup of validation script. Refactor into template to allow customisation of validation. Explicitly set error element to 'span' as per new jquery-validate support [ref: CWPBUG-110]