update: Added event triggering and handling

* Added facilities for event handling and triggering.

Signed-off-by: mr.Shu <mr@shu.io>
tests: Events and save tests.

* Added tests for events and save command.

* Fixed a few issues that showed up while I was trying to make the tests
  pass.

Signed-off-by: mr.Shu <mr@shu.io>