apply moving median before trend analysis

Change-Id: Ib3c63f741980ac5eb1368f6fa2bf0651f21bfa0d
Reviewed-on: http://review.couchbase.org/31531
Reviewed-by: Pavel Paulau <pavel.paulau@gmail.com>
Tested-by: buildbot <build@couchbase.com>