[AS7-6334] Added expression rejection testing. Some refactoring to clean up the extension.