cat: Move os.Stdin assignment into if statement
Create cmd package for shared code