API: Pass extra context information to shortcode handlers.

This allows shortcodes to perform more complex actions on the element
which contains them. For example, the element reference can be used
to add extra classes or attributes to links which provide additional
metadata.
Merge pull request #2507 from ajshort/pull-3

API: Pass extra context information to shortcode handlers.