Use correct path for docs in subfolders

This is for #7077 

I also updated unit tests:
* added test for hints in subfolder
* to use `beforeFirst()` and `afterLast()` callbacks
* to verify all hints (not just first one)
* cleanup hints object