#512 moved timebucket logic to plugin.