Restructured header section.

All sections of the header are now in their own separate container structure allowing for proper formatting. The output generation of the template has been further improved for readability.