Test for writeBlock method, more documentation, and a lot of pedantic whitespace/style changes

I guess this is what happens when I don't have 3 legacy projects keeping me busy.