Update templates, check for element ID. Fixes #119. Thanks to @Visnetje.
Add support for 'required' attribute in input fields
Update debug information, remove debug code