Add include guards, generalize io streams, organize cli