Cleaned up and put modal testing into class.
Revert "Cleaned up and put modal testing into class."

This reverts commit 629af7d47c0bdd3f05ccf3368d1f278839b00016.