minimal restructure of js to use defer and group code
Defering JS load keeps the order defined in HTML for loading, but waits until the other content is loaded. It enables all your JS to be non-blocking but keep the important script ordering.
If this change is accepted, I'll next focus on bringing modules into play to minimize your script overhead.