Adds a refactor of the new, non-adjacent optimizer.

* Extracts common part from simple & complex scenarios.
* Adds performance enhancements.
Readds minification feedback for non-adjacent optimizer.