Patch/text2bool - use common function when converting string to bool

This extends the function text2bool in log.c to allow any non zero numeric and the word 'on' to return 1 (true) and then factors out the duplicated code in a number of places checking boolean options.