refactored threejs specific code out of directives.js, implemented keyframing for traces