Support AST sharing across the detectives and module type detection

Does an initial parse of the file to share the AST between module-definition and the chosen (js-centric) detective. This avoid double-parsing for a performance gain.