Much work towards bug #7581.  All of the tables now implement the right interfaces.  I just need to enable checking for the correct interface.
This fixes #7581.  I cleaned up how the history and average tables were created.