Reworked bounding boxes and entity inheritance structure.

Also removed lots of old code.