Added basic test (using cstdbool)

Assertions or a full test suite wasn't necessary for this.
Also cleaned up code a little bit.