Pull all `<script>` elements into document `<head>` and add `defer` attribute to them to improve script loading characteristics.