Refactor demo.coffee and karma-unit.coffee