Feature/clientlibs optimizer

Refactoring of the PR 47 (https://github.com/Adobe-Consulting-Services/acs-aem-tools/pull/47). Based on the work of @davidjgonzalez. I added some tests this time.