Allow onCompile callback to be defined in config

Resolves #747
Document onCompile in config