Add case-insensitive str2bool function and use it

The source is taken from the original [1], but case-insensitivity flag
is added to the regexes used.

[1] https://github.com/puppetlabs/puppetlabs-stdlib/blob/2c8450d830453e452b819bfb05678768336c3031/lib/puppet/parser/functions/str2bool.rb