Correct data types and minor bug fixes

* replace scala.Dynamic with js.Dynamic
* change types of DDO function from js.FunctionX to js.Function
* fix behaviour in Directive.initialize()