Added a configurable cachedir.

Change-Id: I3f368e3c8b86055f95700ad630c3b16a1d018d3d