createController and createDirective returning instances rather than undefined