Added master/tasks.json endpoint.

This patch lists all running and recent completed tasks, sorted by date
and starting at offset and limited by limit parameter.

Review: https://reviews.apache.org/r/15540