Actually seems like perfect collisions even in all corner cases... am I dreaming?
Creating a copy of Main5.js to work with
Some clean-up, note that the circle can stick into points of lines, that is something to look into