Fix writing trigger results
Allow accessing current trigger names from event

Also add more internal assertion checks in
trigger handling
Add missing dependency in makefile
Add trigger example