Tidy up some one off use return values

This makes the code easier to follow as the indentation provides a visual
indicator as to what is conditional on what.
Refactor occurances of string right whitespce strip to use common function

This improves the readability of the ini parsing code