linkAttribute and other linking cleanup. fixes #6