Add tests of the to-bytes.awk helper script

Also fixed some code formatting in to-bytes.awk so the code is easier
to read.