Answer: The worms may have been tomato horm worms, larvae of a large moth. Just one of these can eat a lot of tomato plant in a hurry, but they are fairly easy to find and remove by hand. Or, you can spray with Bt (Bacillus thuringiensis). The Bt has to be ingested before it affects the worm, so it is a slower control than handpicking. You may not see any at all this year, so keep an eye out and remove as needed.
The little white moths were probably whitefly. These can be controlled with commercially formulated insecticidal soap applied -- and reapplied -- per the label directions. Whitefly it typically a greenhouse pest, so if you purchase your tomato plants inspect them carefully for these before you bring them home to your garden.
Q&A Library Searching Tips