- fixed bug where object references with index higher than 0-9 would
  not be included in the listing of individual entries.

- now outputs a complete SHTML document.

- moved the code around to make it easier to read