ChangeJson: Project control cache is dead; remove it

ChangeJson tries to use Cache<Project.NameKey, ProjectControl> to
optimize construction of ChangeControl in control() method:

  if (cd.hasChangeControl()) {
    ctrl = cd.changeControl().forUser(userProvider.get());
  } else {
    ctrl = projectControls.get(cd.change().getProject())
      .controlFor(cd.change());
  }

However during rendering of multiple changes as result of change query
execution, the condition:

  if (cd.hasChangeControl()) {
    ctrl = cd.changeControl().forUser(userProvider.get());
  }

is always true and the cache is never used. That's because is_visible()
predicate is always get added to the query passed by user in:

  public List<List<ChangeData>> queryChanges(List<String> queries) {
    final Predicate<ChangeData> visibleToMe = queryBuilder.is_visible();
    [...]
    Predicate<ChangeData> q = parseQuery(query, visibleToMe);
    Predicate<ChangeData> s = queryRewriter.rewrite(q, start);

And the is_visible() predicate creates ChangeControl and set it into
ChangeData instance by calling cacheVisibleTo() method:

  void cacheVisibleTo(ChangeControl ctl) {
    visibleTo = ctl.getCurrentUser();
    changeControl = ctl;
  }

Change-Id: I596c1be8f5fcd6060797a9d601d00c982689b6bd
ChangeJson: Make it semi stateless

This is prerequisite to move REST endpoints that are using ChangeJson to
singleton scope. Note the class ChangeJson itself canot be made singleton
because of options attribute.

Change-Id: Ib305ba37fa279c65df6c85a261baad07b32ff3db
ChangeJson: Don't use ChangesCollection

This change removes circular dependency:

  ChangeJson depends on ChangesCollection
  ChangesCollection depends on CreateChange
  CreateChange depends on ChangeJson

by not using ChangesCollection in ChangeJson class.
This is needed to remove the needs to use factory to inject
CreateChange in ChangesCollection. This is needed to move
ChangesCollection and ChangeJson to singleton scope. This is
done in the follow-up change.

Change-Id: I2fc4ac3d7f00e91e934fd496c164555ab751babc
CreateChange: Don't use Factory

Circular dependency was removed:

  ChangeJson depends on ChangesCollection
  ChangesCollection depends on CreateChange
  CreateChange depends on ChangeJson

and now CreateChange can be used directly in ChangesCollection.
The enables us to move both (ChangesCollection and CreateChange)
in singelton scope.

Change-Id: I896cfa562305aa5121bbc61ade4196dd78d624f9
Merge topic 'singleton-ChangeJson'

* changes:
  CreateChange: Don't use Factory
  ChangeJson: Don't use ChangesCollection
  ChangeJson: Make it semi stateless
  ChangeJson: Project control cache is dead; remove it