Refactor snapshot branch functional tests
Add a get_branches function that can be used by test functions to query
snapshot branches with variable parameters.
Add a utility funtion to build query params string from arguments.
Change origin connection test to use the new utility function