added support for figure element and caption; see sample code in functions.xml. Cross references seem to work fine as well