add events and more refactoring

- add the events macro
- extend the todo-app with some events
- split the code into separate files
add swp files to .gitignore