Added command clear-cache to clear the cache.

* No arguments to clear all cache directories, or a branch
  name to clear the cache for that branch.
* Restructured some packages to clean up locations of functions.