Add test CLI, refine interface.
Cleanup.