Support shared urlTemplates among subclasses

Also lets the base class access the beforeSave/afterQuery methods of
each subclass as necessary.