Added ability to set maximum returned datapoints for json requests

If using a web gui for graphite that renders the charts on the browser such as Giraffe or Graphene etc. When the chart extends over a large historical period and there are a large number of datapoints, the browser struggles. 

This pull request allows the client to set a limit to the number of datapoints returned, perhaps limiting to the pixel width of the graph canvas for example, when the limit is exceeded the datapoints are consolidated by some ratio over the whole period akin to what occurs when an chart image is rendered on the server.