Solves the problem of multiple share counters on the page, #1234

This pull adds `input` markers to share counters to avoid having multiple IDs and allow updating several share counters at once. I have decided not to use classes here because the string that has been used for the ID is not really a class. Also, I have prettied the code up a bit.

This is close to a suggestion from #1237, but goes a little further.