added input group nesting level to forms
fixed csrf generation bugs in JS, added more form validations