Added automated generation of cache at first run; added graphical setting for the number of cache time slices; handling of the cache through a dictionary ; + cleanup