Add tests for map, bg layer selector and permalink

This PR adds tests for the map and background layer selector directives, and for the permalink service. And more generally it shows how to tests directives and services.