Hello and welcome.
If I was heading to Cody I would take US14 to from I70 although I not sure why you would then go all the way to Livingston and through Gardiner to enter Yellowstone, you could just stay on US14/16/20 to Yellowstone lake. If you don't mind some 'twisties' you might consider entering Yellowstone through Silver Gate and drive the famous Beartooth Highway from Red Lodge on 212, a majestic drive. US89 is pretty straightforward to answer your question.
I think 19 days is enough time for a relaxed trip and you should have a little time to visit the Tetons just to the south of Yellowstone.
Eating out of the cooler always helps with budget but I can't help with free camping spots. They are probably few and far between around Yellowstone and you need to work out how much time and fuel a 'free' spot could cost. I think showers are available for a small fee, but I will leave that to someone else for comment.