Cleaning up queries, adding functionality to analytics page (date scale, ranges), updating classes to work with new table structure