feat(popover): added template as per requests in issue #220, took code from jbruni

There seemed to be a huge amount of interest in merging in the type of templating @jbruni was using in his fork. However his fork is outdated. This leads to a feature disparity between his fork and the core library. One of my projects requires features from both version, so I took it upon myself to merge them. Hopefully this merge will find its way into the core library where it will help other users who require both sets of functionality. :smile: