Refactor JavaScript includes to footer.php