Store track bounding box and only attempt to draw it if some part of it
is visible on screen.

Bounds are calculated on TrackWaypoint creation (i.e. loading tracks
from a file or acquiring from an external source).

Bounds are recalculated on trackpoint changes.
Where 'simple' this is done within the vik_track update functions,
however much direct trackpoint list manipulation is performed by the TrackWaypoint layer,
such as the various merge and split functions, so the recalculation is called there.

Thus with multiple tracks, this skips attempting to draw all trackpoints
of every marked visible track when no part of the track is within the
current screen bounds.

This should mean Viking is much faster in drawing.

Note this still attempts to draw all trackpoints of a track should you
zoom 'inside' it. But this is not much of a penalty.
Only attempt to draw waypoints when they are in the screens bounding box.

Store bounding box of all the waypoints in a TrackWaypoint layer.
Waypoints bounds are calculated on layer create and whenever the waypoints positions have changed.

Bump minimum glib due to usage of g_hash_table_iter_init ()
Make vik_viewport_coord_to_screen() calculation faster.

Since this function is used for every drawn trackpoint, this can be called
hundreds or thousands of times.

Thus calculate the fixed factors separately only when the dependent values change:
. factors dependent on the zoom level - set when the zoom level changes
. factors dependent on the screen size - set when the screen is resized.
Speed up item selection by restricting search within bounding box limits.

Thus this avoids processing every point for tracks that are not on the screen.
Optimize: Only create waypoint font size string when actual setting is changed.

Rather than performing on every drawing update of every waypoint.
Optimize: Calculate associated icon of a waypoint only on change.

Instead of looking up a hash table on every waypoint draw on every layer draw;
 store the icon reference in the waypoint itself and update only when necessary:

1. When the waypoint icon is changed directly by the user.
or
2. When implicitly changed via the size preference,
 so add method to update all windows and then all waypoints to switch between
 small<->large icons.
GeoRef layer draw: only scale the image when the image will be drawn on the viewport.
Merge branch 'Optimize'
[QA] Better for vik_track reverse to worry about trackpoints.
[QA] Move file related function into file.c and rename for general reuse
Correct spelling of map layer.
SF#3608311: Fix crash caused by renaming blank sublayer names

Don't convert blank text into null for sublayer item names.
Ensure string comparisons have values in rename call.
Prevent inputting empty names for layers and sublayers via the layers panel.