Making the rake file for tests easier to read.

I'm defining a new class which modularizes how the `rake test` tasks are
defined and invoked.
Merge pull request #11134 from wangjohn/object_orienting_testing_rake_file

Making the rake file for tests easier to read.