Question 2: An HTML solution 

$ sed -e 's|1|<b></b>|g' \
      -e 's|0|<i></i>|g' \
      < 02-square-bits > square-bits.html
<style type="text/css">
  b,i {
    display: inline-block;
    width: 15px;
    height: 15px;
  }
  b { background-color: black; }
  i { background-color: white; }
</style>