Added Sinon for function spies.
Added some parameter checking to exec().
Added tests for outputIter() and exec().