Refactored script tests to make them much shorter and more readable.