Added cli tool, and use it for self checking.