My eyes aren't good enough to tell if they are planaria or rhabdocoela, but planaria zero should take care of either. Hang in there, the first few months are often not pretty. As for how they got there, likely came in on your plants. If you plan to keep shrimp in there, might be worthwhile to medicated dip new plants.
Nothing good happens fast in an ecosystem.