Pretty permalinks/shortlinks for attachments.

Converts attachment permalinks and shortlinks to /snap/$id for consideration in #2