Add execuser param to run exec as that user

This also makes some changes to the tests to make them compatible with ruby up to 2.0.0-p195.