Slender-body theory for Stokes flow and flagellar hydrodynamics