Issue 23

I added some tests and better exception handling for percent decoding errors.