example forms.js rewrite, AMD/CommonJS compatible