refactor some modules: lines has to be not bigger than 80 symbols, use macro with clear allocating memory for creating goals stack (instead of explicitly calling std function 'calloc'