Clean up javascript loading order