Attempting to optimize a couple of web_ui list operations.

The tree traversals happen fairly often and during profiling I was seeing a decent amount of garbage being generated. Attempting to minimize garbage.

BUG=

Review URL: https://chromiumcodereview.appspot.com//12388049