Fix table of contents issues with nested items

The table of contents was correctly displaying subitems as a list
within the chapter list, but it was also incorrectly displaying the
subitems as top-level items after the chapter item. This seems to be
because the getTOC method iterates over all of the navPoint items
and is used recursively without distinguishing between top-level
items and subitems.

I added a ternary operator to account for this when setting nodes
and it seems to handle the table of contents more predictably. This
might be handled better but this works for now.

Fixes #122 and fixes #129.