Fix logical sub-expression selection
Use Mock lib
More tests
Test compaction
Testing the optimizer