Adds comments to the isFragmentVisible method

Describes in more detail the logic behind determining
if a fragment is visible, for testing pursposes.