Added the ability to define tooltip templates based on layer fields

Added the ability to define tooltip templates based on layer fields, as an alternative to field based tooltips. If a layer field named "tooltip" is found it will take precedence over tooltip templates (i.e. same behaviour as before).