Refactoring of Boolean module

Removed boilerplate code
Added haddock documentation