Fixed a bug in config

Before was using cache error instead of global error
Completed cache functionality

Added listing, adding and removing features to the
caching subparser and completed the functionality for
these items and the clean and rebuild options.
Also cleaned the code from the cache file a bit.