Added support for non-AJAX form submit
Refactored form generator and handler