Instruction: Describe the roles of the compile and link functions in the lifecycle of an AngularJS directive.
Context: This question probes the candidate's knowledge of AngularJS directives, focusing on two crucial functions that define and manipulate directive behavior.