composer: save only variables and not functions
composer: use proper quotation when creating wrapper script

some general reweriting to make code more readable too