Add test suite; fix gh #8 (double decode)

The test suite documents gh issue #8 with a failing test; the second commit changes decode*() so that it only invokes String.replace() a single time.