Clean up code formatting in blog post

Originally I just wanted to fix the longer lines, but I also did a few
other things like use dictionary literals, make indenting and line breaks
more consistent.