Mostly functional collision system

Functional. Finer details untested, at least 1 known bug.