LPS-48728 refactor repository id methods

Refactor logic for getting a repositoryId.
LPS-48728 check permissions in remote service
LPS-48728 remove base class

I'm going to fuse the two factories into one. The first step in the
refactoring is to get rid of the common base class, moving the code into
the subclasses.
LPS-48728 rename factory methods

Rename factory methods to match those of RepositoryCreator.
LPS-48728 get local repositories using repository factory

Use RepositoryFactory instead of LocalRepositoryFactory to get local
repositories.
LPS-48728 rename local repository methods

In the next commit I'm going to copy the code into
RepositoryFactoryImpl. The renaming will make things easier.
LPS-48728 move code into RepositoryFactory; no logic change

Move all code out of LocalRepositoryFactory and into RepositoryFactory.
LPS-48728 delete LocalRepositoryFactory

Remove interface, classes and Spring bean. No need to deprecate, as
these elements were added in 7.0
LPS-48728 no need to special case internal repositories

Internal and external repositories are created the same way, no need to
check className.
LPS-48728 inline methods

Methods are simple enough, no need to split them in two.
LPS-48728 copy capability collections before modifying

Collections returned by definitions may be shared.
LPS-48728 remove usages of RepositoryCreator and rename

Remove the RepositoryCreator interface, using RepositoryFactory in its
place. Also, rename all variables and methods accordingly.
LPS-48728 SF
LPS-48728 SF
LPS-48728 not thrown
SourceFormatter - exception not thrown
LPS-49147 We call built-in document types: Contract, Basic Document, etc. (in singular, not plural), so we should name it "Google Doc" instead of "Google Docs".
LPS-49147 Revert previous commit. Google's TM for their product is Google Docs, not Google Doc http://www.google.com/permissions/trademark/our-trademarks.html
SourceFormatter - Don't skip common/init.jsp and portal/init.jsp when removing unused imports. We skipped those files as it would increase runtime of SF too much, but after 8a388237246f273b6deb31c96848b18cfc715032 this is no longer an issue.
SourceFormatter - Keep threads balanced