Move time shift logic to Query

Move query modifications to the Query model so we can reuse them. Still
confused about graphite’s timeShift() behavior; seems to fail in graphs
in places it works fine if the response format is JSON