Restructure main and app templates

Start to implement hidden windows bar
Keep hidden windows in logical order