Use CharMatcher in packageNameForGeneratedType()

Instead of performing up to two string copies, use a single replacement
pass, taking into account two characters using a CharMatcher.

Change-Id: I305d384eff2da5d0bfb3b1b820270f4480a800a4
Signed-off-by: Robert Varga <rovarga@cisco.com>
BUG-579: Remove the dependency on GeneratedTOBuilderImpl to break a package cycle.

Change-Id: Ibcdd7bcb0cdf44d5d7ef30105624bede15bcd50e
Signed-off-by: Martin Vitez <mvitez@cisco.com>