Refactored HTML head/foot rendering to expose section positions