The Kustaanheimo-Stiefel transformation in geometric algebra