Javascript / coffeescript mixin function