Dev mapservice refactor

This PR is a major refactoring of mapservice.

It includes
1. better error handling
2. add private method _get_layer_resource
3. better logic in _get_feature_resource
4. Header in htmlpopup base mako
5. layerName translation in feature object

I still need to work on naming convention, but I think it is much better than before.