Reorganize and make a tiny library API.

This makes it importable and callable from Dart.
For performance, pub now pre-compiles executables in your dependencies' bin directories to snapshots when it can. It puts them in `.pub` in your package.

This is the change @nex3 made a few days ago that made pub run 10x in many cases.