Add command-line tool and tests.