A rank-revealing method for low rank matrices with updating, downdating, and applications