Add directives.js, changed things, might be bugs