Reorganize and make a tiny library API.

This makes it importable and callable from Dart.
Just curious, what is this directory for?