Ignoring some special cases of functions getting visibility added when
not in a class.  With some additional tests, some taken from #332.