Use the collection's resourceName in compound docs

For example, if a Project has a related TodoCollection with a key
of 'child_todos' but the resourceName for a Todo is 'todos', then
the API should look like:

  projects: [...]
  todos: [...]

instead of

  projects: [...]
  child_todos: [...]

The key used in the API document shouldn't be dependent on the key in
the parent model.
Support self-referential relationships

This supports parent-child relationships where the parent and child are
the same type. For instance, a Project can have children which are also
projects.

This allows the following API format:

  projects: [
    id: 1
    name: 'Project 1'
    links:
      children: [2, 3]
  ,
    id: 2
    name: 'Project 2'
  ,
    id: 3
    name: 'Project 3'
  ]
Merge branch 'feature/link-type' into develop