refactored how the "head" is generated

also added in favicon support