Submission2 generalize

@adamreis @ianzapolsky 

tried to add some useful infrastructure things, also have a slightly modified TerritorialGainsNearBaseHeuristic in an attempt to improve the MaxTerritoryHueristic.

I'll submit tomorrow at 11 am.