This fixes #7850.  It now checks to see if "30SEC" exists in the average array.  If not, it sets its type to "15MIN".
This fixes #7869.  It now only gets the latest records once.
A tweak for bug #7850.  It defaults the period to 1 day for slow averaging things.