more robust id naming

@jamesshedden `id`s now named for each <a/>, not for enclosing div.