move reading of the dictionary in automaton.c
code style refactoring
split reallocations
renaming some functions