Issue #111 - Use applyWrapper

Use this wrapper instead of generating reduntant code.
There is also some refactoring here around compileApply.