Use str.ljust, etc. instead of string.ljust

The latter no longer exists in Python 3.