Terrain Collision Detection

Kinda of buggy, but the start of a working implementation is here.