Style the main index template, move some template functions and controls and organise the use of the ThemeControls and ThemeFunctions better.