Code cleanup/refactor, added comment blocks for all functions
Added data-exptected attributed for regex validation on field and an optional onValidateField hook, you cannot use both