Added cli support and better output formating.