Refactors and removes duplicated code.    - Removes or comments out code not used.    - Moves duplicated code into functions.    - Simplifies nr of functions by overloading.
Refactors and removes duplicated code.
   - Removes or comments out code not used.
   - Moves duplicated code into functions.
   - Simplifies nr of functions by overloading.

kkdang/synapsePythonClient,thomasyu888/synapsePythonClient,larssono/synapsePythonClient,zimingd/synapsePythonClient