added functions for getting back alternate, next and previous indexes of rules of table of rules
some light into goal module, refactor synt analyzer
refactored goals' module