Moving common functions out
Added common country codes and labels
Minor
Using legend and buildString from common. Reordered SPARQL response