added jquery and widget.js
cleaning up var keyword usage, maintain field type when re-creating an existing input elm, when boolean fields are false, set literal value

also fixed some indentation