Some Refactoring of Faction::GetNearestFactionIndex

Work for #1641
Move of the bulk of the work for non-custom systems from the class method
to an instance method.
Class method now iterates using an iterator.
Have the class method call the instance method on the currently iterated
faction to test whether it's a better fit.
Merge branch 'build/vs2012' into perf/faction-colour
factionColour retrievable in SectorView without full sysgen

Work for #1641
Added Faction::GetNearestFactionColour class method.
Added Sector::ColourFactions method that populates a sector's
system with the correct base factionColour.
Setting of factionColour in SectorView::Draw3d removed.
Added call to populate factionColour for full sector to
SectorView::GetCache when a new sector is added to the cache.
Add some constants and use them

BAD_FACTION_COLOUR - the colour for system we found no faction for
FACTION_BASE_ALPHA - the alpha for faction systems where we don't know the population yet
Switch to checking population to get if a system in inhabited

Work for #1641
We need to know if a system is inhabited to mark uninhabited systems as not
part of a faction on the map.
Unfortunately there's no way to determine this without a full sysgen, so
we might as well switch to using population rather than count of starports
to check this and save ourselves a bunch of messy flag twiddling code.
Vary label brightness/alpha based on population

Okay I couldn't resist :)
Avoid Constructing Sectors we already have when getting Faction distances

Work for #1641
Refactored Faction::GetNearestFactionColour and associated methods to
take a Sector and a system index rather than a SystemPath, so we can avoid
constructing the Sector again (and doing mini-sysgen) just to get the
distance.
Added Sector::Contains method, answering whether a SystemPath is within
the Sector.
Uncomment incorrectly commented out code

Oops! Systems in the same sector as Faction homeworlds
should now be automatically being placed in that Faction
again.
Cache the homeworld Sector on the first distance calculation

We no longer construct the homeworld's Sector, doing mini-system
for each system it contains, every time we do a Faction distance
calculation.
Instead We cache the Sector the first time we do a distance
calculation, and then reuse it.
I considered caching the homeworld sector when the homeworld is
set from Lua, but Sector(0,0,0) constructed at that point
appears to be invalid (possibly Sol hasn't loaded yet?)
Expose radius attribute to Lua

Since we now have a Faction::Radius method, we might as
well allow you to get the value from Lua.
Bump availability of l_faction_attr_radius to Alpha 29

Since we're now in freeze for Alpha 28.
Also removed repetition of the word 'volume' from the comments
of the above method.
Allegiance calc. of systems in Faction's home sector less broken

I was setting closestFactionDistance to zero, rather than distance to
zero. Oops!
Use log scale for calculating label colour alpha in Sector View

Since most of our inhabited systems have <500 million inhabitants,
but we have a few systems with populations in the multi-billions
something log based makes more sense.
Also fixes the bug whereby systems coming into view whilst scrolling
were set the wrong initial alpha.
Merge branch 'perf/faction-colour' into enhance/sectorview-factions-zoom
Merge branch 'feature/factions-auto' into enhance/sectorview-factions-zoom

Conflicts:
	src/Factions.cpp
	src/Factions.h
Initial version of super zoom-out in sector view

Renamed SectorView::DrawSector method to DrawNearSector.
Extracted a new DrawSectors method from Draw3D.
Added a new SectorView::DrawFarSector method.
Added a new SectorView::DrawFarSectors method.
Changed Draw3d to call DrawFarSectors if you're zoomed out above the
current zoom limit, and DrawNearSectors if you're zoomed in below
the current zoom limit.
Adjust zoom limit upwards.
Updated SectorView::ShrinkCache to handle the greater number of sectors
needed by DrawFarSector.
Added a number of instance variables needed by DrawFarSector to ensure
it doesn't kill framerate (vertex & colour arrays, current viewable
sector ranges etc.)
Switch from using FactionIdx and FactionColour to Faction*

Where we have previously reference a Faction index or a Faction colour
value, we should now be using a pointer to the actual Factions.
This is in prepartion for displaying Faction names in the Sector view.
Added Factions Panel to Sector View naming factions shown

This is accessed by TAB, which now cycles between the info panel, this
new factions panel, and no panel, instead of toggling the info panel on
and off.
Tweaked the radius calculation of the when in Far Zoom mode to be less
weird at lower levels of zoom out.
Fix Faction panel not updating when in Near Zoom mode

Moved call to update the faction panel from DrawFarSectors to Draw3D.
Add mechanism for not drawing systems of selected Factions

Not hooked up to anything yet.