Added some sql query stuff
Revamped table name creation

Made the process neater and it specifies what the qualifier is in a clearer way.
States.py cycles through all tables

Checks state frequencies for all tables.