Clean up test suite

Refactored test suite to reduce code complexity. Added "contains"
helper.