Improve trunk, fix errors in branches

I also refactored out some mostly trivial code for retrieving fwd, rev
primers from a given long sequence, start, and length.