Restructured the settings modal

This commit also includes improvements to storage, analytics and modal
handling.