Moved to main.js all JavaScript that is not specifically about mapping or data processing