The excess degree of a polytope and some of its applications