Separated logic from sql in _query.
Refactored get_fields.
Reenabled row cache.
Refactored get_distinct_values.
Refactored __len__.
Refactored get_stats.
PEP8
Pass optional parameters to psycopg2.
Refactored get_distributions.