change dicts to defaultdicts

If a dictionary stores only one type of value (e.g. tuple), we can use defaultdict data type to speed up the code and it also helps self-documentation.
I've tried to find dictionaries with single type values and changed those to appropriate defaultdict types.
Let me know if there is an error.