refactor(directives): Refactor directives and templates using builder

This also adds preLink and postLink directive events