Better attachment URL formation

Also adds bp_docs_attachment_url_base filter

Props @wdfee

Fixes #344