gaLayers refactoring

This PR is a major refactoring of the gaLayers service. The commit messages include details about the work done, so I'd suggest reviewing this PR commit by commit.

This PR depends on #230. Please review.