Add NewRelic support so transactions are grouped correctly.

This may be merged, or just be a useful reference for other users who use NewRelic.

NewRelic monitors the performance of an application. It reveals slow points and what aspects are used the most. This is very useful for an API that gets a reasonable amount of traffic.

Out of the box, NewRelic can't identify the API calls and they all get pooled as /index.php.
This patch simply takes the class and method of the API and passes it on to NewRelic giving a far better result.

It will have no impact if NewRelic isn't used.