Added a decode_query() convenience function.