added toQueryString() and fromQueryString() methods