Fix table cell @id and @headers attributes #1596

**[Gist](https://gist.github.com/eerohele/9980525)**.

Besides #1596, there's another semi-related issue to table cells: the `@id` attribute on `<thead>` elements in regular tables is not retained in the XHTML output. Instead, it's replaced by a generated ID, which means links to `<entry>` descendants of `<thead>` will break. Likewise, the `@headers` attribute on the corresponding `<entry>` elements in the table body uses the generated ID instead of the `@id` attribute value of the header.

This pull request should fix all three issues. Might make more sense to have the XSL functions elsewhere, so just let me know if you'd like to move them (should we have something like `functions.xsl`, for example?).

The original code checked whether the current table is a descendant of `topic/body` for some reason so I kept that in, although I couldn't think of a case where a table or a simpletable would be outside of a topic body.