ui/viewer: Throw if callbacks aren't functions

We should not allow people to mistakenly pass in non-functions as
callbacks. If they do so by accident these will just get swallowed and
no errors will be thrown.