Be way smarter about errors by using exceptions where appropriate.

In particular it's now no longer possible to obtain a "null" Function
object in client code (any operation which would have to return this
would throw instead).

This is great, since it removes some potential undefined behaviour.
It would otherwise be impossible to sensibly handle the case where
C++ code called from Yang returns some null Function, because
*something* has to be returned.