Colinmacdonald/730 error not found

Adds an error for when an element is not found locally.
Adds support for emitting or throwing an error.
Adds tests for registering a listener.