Fixed the form example

@matsko could you please review this PR

- The first two commits are fixes (the example would not work without them),
- The last 2 commits are refactoring:
  - change the directory structure to match other examples,
  - some refactor in html & dart