Dynamically adapt column size in lists

When hostnames are too long, they tend to get on top of each other in the unresponsive list, which is not very useful.

This patch sets the number of columns and column size dynamically to avoid this behaviour.

While I'm at it, I've added Util functions so we can do that everywhere.
I think these two lines would be clearer as:

```
format = "   " + (" %-#{field_size}s" * fields_num)
```