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.
Use command-line arg instead of flags to set project type.

Fixes setting of project type