Spock testing and test refactoring

This pull request has no new features, but I took the liberty of suggesting a few refactorings for the testing. Think it will pay off in the long run. Spock is pretty cool as well.

Highlights:
- More unittests ( a few problem areas remain, notably anything that interacts with jsch)
- Fewer integrationtests as these should be to a larger degree covered by unit tests

Let me know if you have any questions or issues with the pull request.