progress on box and collision

also misc refactoring