Split up the while/if test suites into smaller parts.

This will make it easier to quickly see what has failed when things fail,
vs. the previous setup where many different orthogonal assertions were
combined together into a single function.