Converted test to Groovy using Spock, parameterized URI decoding test

This is that thing that was brought up in #982 .

I didn't change the logic for the existing tests, only the structure (to make them mesh more with the Groovy/Spock way of doing things). Some variables and mocking behavior also had to be moved around to kill off those inner test classes.