Improved EDSL syntax: rules can now refer to rules defined after them, no predeclaration required. Also some refactoring: improved naming and code structure.