Add modules and tabs logic to dashboard view

Now deals correctly with single module and tab dashboards requested by spotlight
I get 2 test failures on master which can be fixed by removing this `json.dumps` and the one in the test below, but the build succeeded on Travis. Can anyone else reproduce?