Cross browser fixes

Fixes Object.keys(validity) issue in Firefox.
Fixes element.form being null across browsers