Hamiltonian motions of plane curves and formation of singularities and bubbles