update buildURLForHasMany hook

Implement #2168 buildURLForHasMany hook on current build. It uses an explicit buildURL option rather than depending on links and ids being nil.  I'm with @tomdale that a dsl is needed but I have needed/wanted this feature from day one. 

@igorT  let me know #2168.