Moved SQL from blue carbon layer in to lib/ file
Major refactor of the Area of Interest statistics generation to make it
considerably easier to understand (work in progress)