Still needs implementing format_as_block, and switching input and output to use sys.stdin.readline() and sys.stdout.write(line).