Improve map-legend field unit lookup.

The old method used global state, but this change makes
the legend find the DB collection via its parent map control.
Merge branch 'master' of github.com:IMQS/js-map

Conflicts:
	map-legend.js