Made test_case function

Refactor test_systems into a loop over test_case. This prepares for
new functionality. Also cleaned up indentation and whitespace. No
overall functionality changes.

Refs #1337

Change-Id: I7068a63c14a1ef27c5bfbbc6251d14f8557284ce