Add a parseBoolean function

This implements and closes #325, unless more features are wanted.

I hope the coding style is alright?