Allow url and scope to be functions on model class and instance (Fixes #472)

Resubmission of #474 based on current Spine dev branch. Only includes altered source files.