Optimal Design of a Molecular Recognizer: Molecular Recognition as a Bayesian Signal Detection Problem