Add `id` attribute and more tests

- add `id` attribute to `Element`
- add more tests for implicit keys
- fix helper methods