Clean up sfepy/base/base.py and sfepy/terms/terms.py