Extracted clean_gems from execute
Use multiple passes to clean gems

Previously gem cleanup ran only once.  This would leave around gems that
could be cleaned up due to recently orphaned dependencies.

Now cleanup runs until no gems remain to clean up or the set of gems
that could be cleaned up is the same as the previous set (in the case of
a dependency).

Fixes #422