Foundational principles for large scale inference: Illustrations through correlation mining