Dashboard save

Added saving feature for dashboard widgets.
Tidied code up.