Gapped alignment of protein sequence motifs through Monte Carlo optimization of a hidden Markov model