Move velocity check out of collision detection.

This is another step toward generalizing collision detection for any
caller. In this case, I need to check collision even if velocity == 0,
which wouldn't work with the previous setup. The update() code is a bit
uglier now with those extra if statements, but for now this is still an
improvement.