Made popup scrollable if needed.
Added active flag to templates.
Refactored settings to template list activity.
Fixed bug with settings activity being brought to front when popup was shown.