Factor out (raw)last_block().
Fix some code alignment.
Implement to_string().