Pass the current element to before and after hooks

This allows for per-element configuration where there are multiple share buttons on the same page.