Cleanup: coding style fixes
Simplified code
Unify table sorting across overview pages

Fixes #47.
Fix #51. Invalidate cache when unit state is set to OBSOLETE