Move shell command execution out of builder into separate class and fix issue #218

The builder class is quite large and this in my first step at breaking it down a bit. It should make it a bit easier to unit test. At the same time I've fixed issue #218 as it was quite straight forward to do whilst extracting the execution code.