Changed GrammarRule to adhere to some pep8 guidelines
Random style fixes
Fixed missing import (math.log)
Changed all 'expansion's back to 'to's temporarily
Refactoring