Fix problem getting css_class with default config.

The code tried to treat this as a dictionary instead of a simple
string.

Refactored the get_configured_fields method for this, because flake8
complained that it had become too complex.