Question 2: An HTML solution 

$ sed -e 's|1|<b></b>|g' \
      -e 's|0|<i></i>|g' \
      < 02-square-bits > square-bits.html