Refactored to simplification-patterns and improved entry of simplification patterns.
Unused var bugfix.