Bandit Theory and Thompson Sampling-Guided Directed Evolution for Sequence Optimization