Add getLength() method.
Refactor update() function so collision detection and resolving are located in decoupled functions. This is prep for in the future encapsulating this functionality.
Improve readability.