Decode query params on get and export decode function.

With tests.