moving some shared logic into new tool lib

Better output on 'pub install' fail
bin/generate: removed superflous imports
GenerateResult, fixed some util functions
A bit ugly, but it does analyze all the libraries

Closes #73