[ty] Move some module name helper routines to methods on `ModuleName`
These were previously only used in auto-import, but we'll
want to use them for filtering subtypes too. So put them
in a more central location.
I think these codify pretty solid ecosystem conventions,
but I've added some cautionary language to the docs for
these methods.