Added share link and hide labels link

Also finished off the rejig of the underlying data and tidied some
unused code.