Separating JavaScript for charts and maps