Event handling with pub sub refactore and simplified.

- More unit tests.
- Image object to canvas.