Added callback function on new dictionaries downloading fails

+ Refactoring a bit
Cache dictionaries after downloading