Output formatting and CLI usage

I hope these modifications are useful for others.