Refactor compiler tests to use sinon.js
Slight refactor to compiler to move method definition out of compile()