Add cache clean and list commands.

This was an huge commit.
- Allow nested commands
- Switch resolve cache in memory object cache to LRU
- Store non-semver packages in the cache
- Tweak help messages
- Various fixes and tweaks