Refactor config options into configure().
Add a persistent store and cache.

Change-Id: I0838cf229b3c760d723d79483c2832e221d46425