WIP

Change-Id: I1edbbd6b84035327d874448891a5bab6b15b11d2
About to refactor.

Change-Id: I00800b737fed15eb18d08c8d395fb3cd310e9a64
Add more class-level caching.

Change-Id: I44c1a02ec0877d523783cb2bb4ed0ff673a857f8