Added logic to clear_cache to prevent IPython parallel memory leaks.