Added decodeQuery (fixes #48)