Throw error if not given expectations
Remove debug io:format call
Switch to invocation handler pattern

This design should be much simpler to maintain and extend.  Also closes
#2.