add correct handling of query params in server sync, fixes #388 and fixes #350

This fixes #388 and #350

This also fixes an issue with redundant params getting set as querystring params in ajax calls from clientSync.
e.g.  /issues/123?id=123