physics: implemented elastic collisions

Works, except when it doesn't. Needs tweaking. I want to condider collisions before objects clip through each other. Now, on to the structure detection algorithm.