Cleanup Lens main script.

Up to now, we have duplicated this file to create modified versions.
This change introduce a proper architectural approach.