Move per-widget time settings to directive and support setting Graphite time

The three commits in this PR are already logically separated units and intended to remain unsquashed as they are.