Cleanup. Moved javascript in dashboard view to separate js file.