more control on topicref and structures attributes

- re-implemented href subdirs based on type and id
- outputclass attributes controled by DEBUG var