compilation moved to compile pre function in directive

closes #6