Check handler is class in URLSpec.

Some simple cases for user error in supplying handlers can end up with
the URLSpec being given bad arguments. If the 'handler' arg isn't a
class, nothing fails right away, but later an obscure error about
an internal attribute not being a class is raised.

This change catches the problem when it happens, and provides context to
help the user hunt it down.