Better error reporting

- Allow passing an exception to the apiProblemResult plugin
  - Grabs message by default
  - If the flag detailIncludesStackTrace is true, will also include
    stack trace in detail message
- array_intersect_assoc was not doing what I expected; replaced with an
  iteration routine that ensures all expected values of the problem
  payload are merged
Fixes to pagination and error reporting

- Do not show first/last links if only one page
- Include previous exception information in API-Problem detail when
  exceptions are enabled