Refactor the signature of link_to_document

The second argument should now be a symbol of the field, a proc to
evaluate or a string. The third arugment is the options hash. Fixes #1018