Cleanup dashboard

Cleanup dashboard code in preparation for porting to Mustache. This includes using CSS effectively, disentangling logic from presentation a bit etc...